-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add semantic release workflow (#5)
- Loading branch information
1 parent
69e6b82
commit d36a71b
Showing
4 changed files
with
96 additions
and
104 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,43 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- '[0-9]+.*' | ||
|
||
jobs: | ||
createReleaseVersion: | ||
name: Create Release Version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
releaseVersion: ${{ steps.release.outputs.releaseVersion }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
- name: Lint | ||
run: | | ||
npm run lint -- -- --no-fix --max-warnings 0 | ||
- name: Test | ||
run: | | ||
npm run test:unit:ci | ||
- name: Create Release Version | ||
id: release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: npx semantic-release |
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,39 @@ | ||
{ | ||
"branches": [ | ||
"+([0-9])?(.{+([0-9]),x}).x", | ||
"main", | ||
"next", | ||
"next-major", | ||
{ | ||
"name": "beta", | ||
"prerelease": true | ||
}, | ||
{ | ||
"name": "alpha", | ||
"prerelease": true | ||
} | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"npmPublish": false | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [] | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"successCmd": "echo '::set-output name=releaseVersion::${nextRelease.version}'" | ||
} | ||
] | ||
] | ||
} |
Oops, something went wrong.