| 1 | name: Release |
| 2 | on: |
| 3 | push: |
| 4 | branches: [main] |
| 5 | |
| 6 | concurrency: |
| 7 | group: ${{ github.workflow }}-${{ github.ref }} |
| 8 | cancel-in-progress: false # Prevent newer push from interrupting active release |
| 9 | |
| 10 | permissions: {} |
| 11 | |
| 12 | jobs: |
| 13 | release: |
| 14 | if: github.repository_owner == 'Effect-Ts' |
| 15 | name: Release |
| 16 | runs-on: ubuntu-latest |
| 17 | timeout-minutes: 30 |
| 18 | permissions: |
| 19 | contents: write |
| 20 | pull-requests: write |
| 21 | id-token: write |
| 22 | steps: |
| 23 | - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 |
| 24 | with: |
| 25 | # This is required to ensure the `GITHUB_TOKEN` we provide below is |
| 26 | # **always** used when pushing updates to the changesets release branch. |
| 27 | # Otherwise the default token will be used, and actions on that versioned |
| 28 | # release branch will not be triggered. |
| 29 | persist-credentials: false |
| 30 | - name: Install dependencies |
| 31 | uses: ./.github/actions/setup |
| 32 | - name: Upgrade npm for OIDC support |
| 33 | run: npm install -g npm@11 |
| 34 | - name: Create Release Pull Request or Publish |
| 35 | id: changesets |
| 36 | uses: changesets/action@d0ee272882939fa35f22d979828acb7e61e0bd47 # v2.0.0-next.4 |
| 37 | with: |
| 38 | version-script: pnpm changeset-version |
| 39 | publish-script: pnpm changeset-publish |
| 40 | # Use a personal access token instead of the one that GitHub generates |
| 41 | # automatically to ensure workflows get triggered on the changesets |
| 42 | # release branch. |
| 43 | github-token: ${{ secrets.CHANGESET_GITHUB_TOKEN }} |
| 44 | - name: Deploy website |
| 45 | if: steps.changesets.outputs.published == 'true' |
| 46 | uses: ./.github/actions/deploy-website |
| 47 | with: |
| 48 | channel: v4 |
| 49 | dispatch-token: ${{ secrets.WEBSITE_DISPATCH_TOKEN }} |
| 50 | revision: ${{ github.sha }} |