Release #12
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_dispatch: | |
| inputs: | |
| debug: | |
| description: "Debug (no version bump, no publish, no tag)" | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| release: | |
| name: Semantic release | |
| runs-on: | |
| - ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.PARATCO_BOT_ID }} | |
| private-key: ${{ secrets.PARATCO_BOT_KEY }} | |
| - name: Get GitHub App User ID | |
| id: app-user-id | |
| run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| check-latest: true | |
| - name: Enable Yarn | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Semantic Release (Debug Dry Run) | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| run: yarn release-dry-debug | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| NPM_TOKEN: ${{ secrets.NPM_WRITE_TOKEN }} | |
| GIT_AUTHOR_NAME: ${{ steps.app-token.outputs.app-slug }}[bot] | |
| GIT_COMMITTER_NAME: ${{ steps.app-token.outputs.app-slug }}[bot] | |
| GIT_AUTHOR_EMAIL: ${{ steps.app-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com | |
| GIT_COMMITTER_EMAIL: ${{ steps.app-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com | |
| - name: Build | |
| if: ${{ github.event.inputs.debug != 'true' }} | |
| run: yarn build | |
| - name: Semantic Release | |
| if: ${{ github.event.inputs.debug != 'true' }} | |
| run: yarn release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| NPM_TOKEN: ${{ secrets.NPM_WRITE_TOKEN }} | |
| GIT_AUTHOR_NAME: ${{ steps.app-token.outputs.app-slug }}[bot] | |
| GIT_COMMITTER_NAME: ${{ steps.app-token.outputs.app-slug }}[bot] | |
| GIT_AUTHOR_EMAIL: ${{ steps.app-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com | |
| GIT_COMMITTER_EMAIL: ${{ steps.app-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com |