fix for SuspenseRoot #321
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 Flow | |
| on: | |
| push: | |
| branches: [master, next] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write | |
| pull-requests: write # Required to create a release PR | |
| checks: write # Required to create a check run | |
| issues: write # Required to create issues | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| environment: | |
| name: NPM Registry | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| # https://github.com/actions/checkout/issues/1471 | |
| - name: Fetch tags | |
| run: git fetch --prune --unshallow --tags | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup node and restore cached dependencies | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Install packages | |
| run: pnpm install --frozen-lockfile | |
| - name: Cache turbo build setup | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - name: Build | |
| run: pnpm build | |
| - name: Resolve publish tag | |
| id: publish-tag | |
| uses: actions/github-script@v8 | |
| with: | |
| result-encoding: string | |
| script: | | |
| const fs = require('fs'); | |
| try { | |
| return JSON.parse(fs.readFileSync('.changeset/pre.json', 'utf8')).tag; | |
| } catch { | |
| return 'latest'; | |
| } | |
| - name: Create Release Pull Request or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: pnpm ci-version | |
| commit: 'chore: update versions' | |
| title: 'Release plan' | |
| # https://github.com/changesets/action/issues/246 | |
| # https://github.com/changesets/changesets/pull/674 | |
| publish: pnpm ci-publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| PUBLISH_TAG: ${{ steps.publish-tag.outputs.result }} | |
| PUBLISH_BRANCH: ${{ github.ref_name }} |