chore(deps): update node.js to v22.21.0 (#400) #304
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| draft_release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| outputs: | |
| tag_name: ${{ steps.release-drafter.outputs.tag_name }} | |
| steps: | |
| # Get next version | |
| - uses: release-drafter/release-drafter@v6 | |
| id: release-drafter | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: prod | |
| url: https://www.npmjs.com/package/junit2json | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| id-token: write | |
| needs: draft_release | |
| if: github.event_name == 'workflow_dispatch' | |
| steps: | |
| # Create version string from tag (v1.0.0 -> 1.0.0) | |
| - name: Create version string | |
| run: | | |
| export TAG_NAME=${{ needs.draft_release.outputs.tag_name }} | |
| echo "VERSION=${TAG_NAME:1}" >> $GITHUB_ENV | |
| # Use GitHub App for bypassing ruleset guard when git push by npm publish | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.BYPASS_APP_ID }} | |
| private-key: ${{ secrets.BYPASS_APP_PRIVATE_KEY }} | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: master | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Setup git config | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| registry-url: 'https://registry.npmjs.org' | |
| # Ensure npm 11.5.1 or later for trusted publishing | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| # npm publish and push updated package.json | |
| - name: Publish to npm and jsr | |
| run: | | |
| npm run release -- $VERSION | |
| git push origin master | |
| # Publish github releases. Also tag will be created. | |
| - uses: release-drafter/release-drafter@v6 | |
| with: | |
| publish: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |