Merge pull request #12 from bun913/chore/version-adjustment #2
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
release: | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get semantic version | |
id: semver | |
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/v}" | |
- uses: actions/checkout@v4 | |
with: | |
ref: v${{ steps.semver.outputs.version }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org" | |
- name: Update package version | |
run: npm version ${{ steps.semver.outputs.version }} --no-git-tag-version | |
- name: Commit updated package version | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore: Update package version" | |
branch: main | |
- name: Update Git tag | |
run: | | |
git tag ${{ github.ref_name }} -f | |
git push origin ${{ github.ref_name }} -f | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |