-
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.
chore(release.yml): simplify release workflow and update Node.js setup
chore(package.json): add @semantic-release/commit-analyzer dependency
- Loading branch information
Showing
3 changed files
with
28 additions
and
41 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 |
---|---|---|
@@ -1,53 +1,36 @@ | ||
name: Semantic Release | ||
|
||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev/* | ||
- feature/* | ||
- hotfix/* | ||
|
||
jobs: | ||
semantic-release: | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
permissions: | ||
contents: read | ||
|
||
name: Semantic Release | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-node@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
|
||
- name: Prepare prerelease semantic | ||
if: github.ref != 'refs/heads/main' | ||
run: mv .releaserc.prerelease.yaml .releaserc.yaml | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
id: semantic # Need an `id` for output variables | ||
with: | ||
semantic_version: 17 | ||
extra_plugins: | | ||
@semantic-release/changelog@5 | ||
@semantic-release/exec@5 | ||
@semantic-release/git@9 | ||
- name: "Install pnpm" | ||
run: "npm i pnpm@latest -g" | ||
- name: Install dependencies | ||
run: pnpm clean-install | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Do something when a new release published | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: | | ||
echo ${{ steps.semantic.outputs.new_release_version }} | ||
echo ${{ steps.semantic.outputs.new_release_major_version }} | ||
echo ${{ steps.semantic.outputs.new_release_minor_version }} | ||
echo ${{ steps.semantic.outputs.new_release_patch_version }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: pnpx 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.