ci(release): attribute push-back to uinaf-releaser (#32) #96
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify: | |
| if: github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') | |
| name: Verify workspace | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up pnpm native binary | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| standalone: true | |
| - name: Set up Vite+ | |
| uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: true | |
| - name: Verify library | |
| working-directory: packages/react-json-logic | |
| run: vp run verify | |
| - name: Verify example app | |
| working-directory: apps/example | |
| run: vp run verify | |
| release: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') | |
| name: Release react-json-logic | |
| needs: | |
| - verify | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| environment: release | |
| concurrency: | |
| group: release-${{ github.repository }}-main | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up pnpm native binary | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| standalone: true | |
| - name: Set up Vite+ | |
| uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: false | |
| - name: Build library | |
| working-directory: packages/react-json-logic | |
| run: vp pack | |
| - name: Create release bot token | |
| id: release-bot | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ vars.UINAF_RELEASE_APP_ID }} | |
| private-key: ${{ secrets.UINAF_RELEASE_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ github.event.repository.name }} | |
| permission-contents: write | |
| permission-issues: write | |
| permission-pull-requests: write | |
| - name: Authorize release writes | |
| env: | |
| GH_TOKEN: ${{ steps.release-bot.outputs.token }} | |
| run: gh auth setup-git | |
| # GitHub links bot commits when the noreply email uses `{user-id}+{slug}[bot]@…`. | |
| - name: Resolve release bot identity | |
| id: release-bot-identity | |
| env: | |
| GH_TOKEN: ${{ steps.release-bot.outputs.token }} | |
| APP_SLUG: ${{ steps.release-bot.outputs.app-slug }} | |
| run: echo "user-id=$(gh api "/users/${APP_SLUG}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| - name: Release package | |
| uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0 | |
| with: | |
| working_directory: packages/react-json-logic | |
| extra_plugins: | | |
| @semantic-release/commit-analyzer@13.0.1 | |
| @semantic-release/release-notes-generator@14.1.1 | |
| @semantic-release/npm@13.1.5 | |
| @semantic-release/git@10.0.1 | |
| @semantic-release/github@12.0.8 | |
| conventional-changelog-conventionalcommits@9.3.1 | |
| env: | |
| GITHUB_TOKEN: ${{ steps.release-bot.outputs.token }} | |
| GH_TOKEN: ${{ steps.release-bot.outputs.token }} | |
| GIT_AUTHOR_NAME: ${{ steps.release-bot.outputs.app-slug }}[bot] | |
| GIT_AUTHOR_EMAIL: ${{ steps.release-bot-identity.outputs.user-id }}+${{ steps.release-bot.outputs.app-slug }}[bot]@users.noreply.github.com | |
| GIT_COMMITTER_NAME: ${{ steps.release-bot.outputs.app-slug }}[bot] | |
| GIT_COMMITTER_EMAIL: ${{ steps.release-bot-identity.outputs.user-id }}+${{ steps.release-bot.outputs.app-slug }}[bot]@users.noreply.github.com |