Repository navigation
Release #115
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: | |
| workflow_run: | |
| workflows: | |
| - CI | |
| types: | |
| - completed | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| concurrency: | |
| group: release | |
| cancel-in-progress: true | |
| jobs: | |
| release: | |
| if: >- | |
| github.event.workflow_run.conclusion == 'success' && | |
| github.event.workflow_run.event == 'push' && | |
| github.event.workflow_run.head_branch == 'main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check validated commit is still current | |
| id: head | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VALIDATED_SHA: ${{ github.event.workflow_run.head_sha }} | |
| run: | | |
| current=$(gh api "repos/$GITHUB_REPOSITORY/commits/main" --jq .sha) | |
| if [[ "$current" == "$VALIDATED_SHA" ]]; then | |
| echo "current=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "current=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/checkout@v7 | |
| if: steps.head.outputs.current == 'true' | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.workflow_run.head_sha }} | |
| - uses: actions/setup-node@v7 | |
| if: steps.head.outputs.current == 'true' | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| package-manager-cache: false | |
| - name: Install release tooling | |
| if: steps.head.outputs.current == 'true' | |
| run: npm ci --ignore-scripts | |
| - name: Publish semantic release | |
| if: steps.head.outputs.current == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: npx semantic-release |