-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use semantic-release to create automated releases (#5)
* feat: use semantic-release to create automated releases * fix: use "main" branch
- Loading branch information
1 parent
a026d5d
commit dfed3dd
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }} | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Setup 7zip | ||
uses: milliewalky/setup-7-zip@v1 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Fix auto-fixable eslint issues | ||
run: npm run eslint -- --fix | ||
|
||
- name: Update the ToC in the README.md | ||
run: npx markdown-toc README.md -i | ||
|
||
- name: Semantic release | ||
uses: codfish/semantic-release-action@v3 | ||
with: | ||
additional-packages: | | ||
['@semantic-release/git', '@semantic-release/changelog', '@semantic-release/exec'] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"npmPublish": false | ||
} | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "npm run build && 7z a app.7z ./out/*" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"CHANGELOG.md", | ||
"package.json" | ||
], | ||
"message": "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [ | ||
{ | ||
"path": "app.7z" | ||
} | ||
] | ||
} | ||
] | ||
] | ||
} |