Release Version #5
This file contains hidden or 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 Version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "npm version argument, for example patch, minor, major, or 1.2.3" | |
| required: true | |
| default: patch | |
| permissions: | |
| contents: write | |
| jobs: | |
| release-version: | |
| runs-on: ubuntu-latest | |
| environment: release | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| token: ${{ secrets.RELEASE_TOKEN }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| package-manager-cache: false | |
| - run: npm ci | |
| - run: npm version "${{ inputs.version }}" --no-git-tag-version | |
| - run: npm run check | |
| - run: npm run build | |
| - run: | | |
| version="$(node -p "require('./package.json').version")" | |
| git config user.name "${{ vars.RELEASE_COMMITTER_NAME || 'release-bot' }}" | |
| git config user.email "${{ vars.RELEASE_COMMITTER_EMAIL || 'release-bot@users.noreply.github.com' }}" | |
| git add package.json package-lock.json | |
| git commit -m "chore: release version" | |
| git tag "v${version}" | |
| git remote set-url origin "https://x-access-token:${{ secrets.RELEASE_TOKEN }}@github.com/${{ github.repository }}.git" | |
| git push origin main "v${version}" |