Merge pull request #106 from tf-actions/dependabot/npm_and_yarn/types… #172
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: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| 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@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "lts/*" | |
| - name: Install dependencies | |
| run: npm clean-install | |
| - name: Audit dependencies | |
| run: npm audit | |
| - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies | |
| run: npm audit signatures | |
| - name: Release | |
| id: release | |
| uses: cycjimmy/semantic-release-action@v6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update Git Tags | |
| if: steps.release.outputs.new_release_published == 'true' | |
| run: | | |
| major=${{steps.release.outputs.new_release_major_version}} | |
| minor=${{steps.release.outputs.new_release_minor_version}} | |
| # Configure Git | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| # major.minor | |
| tag=$(printf 'v%d.%d' $major $minor) | |
| git tag -fa $tag -m "Version $tag" | |
| git push origin $tag --force | |
| # major only | |
| tag=$(printf 'v%d' $major) | |
| git tag -fa $tag -m "Version $tag" | |
| git push origin $tag --force |