Update Primer React to latest version #114
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: | |
| push: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| checks: write | |
| statuses: write | |
| jobs: | |
| release-main: | |
| if: github.ref_name == 'main' | |
| name: Main | |
| uses: primer/.github/.github/workflows/[email protected] | |
| secrets: | |
| gh_token: ${{ secrets.GPR_AUTH_TOKEN_SHARED }} | |
| release-candidate: | |
| if: ${{ github.repository == 'primer/doctocat-nextjs' && github.ref_name == 'changeset-release/main' }} | |
| name: Candidate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Publish release candidate | |
| run: | | |
| npm exec --workspaces -- ../../packages/repo-configs/scripts/prepare-release-candidate | |
| npx changeset publish --tag next | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Output canary version | |
| uses: actions/[email protected] | |
| with: | |
| script: | | |
| const paths = ['theme'].forEach((path) => { | |
| const package = require(`${process.env.GITHUB_WORKSPACE}/packages/${path}/package.json`) | |
| github.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: context.sha, | |
| state: 'success', | |
| context: `Published ${package.name}`, | |
| description: package.version, | |
| target_url: `https://unpkg.com/${package.name}@${package.version}/` | |
| }) | |
| }) | |
| release-canary: | |
| if: ${{ github.repository == 'primer/doctocat-nextjs' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' }} | |
| name: Canary | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Publish canary release | |
| run: | | |
| npm exec --workspaces -- ../../packages/repo-configs/scripts/prepare-canary | |
| npx changeset publish --tag canary | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Output canary version | |
| uses: actions/[email protected] | |
| with: | |
| script: | | |
| const paths = ['theme'].forEach((path) => { | |
| const package = require(`${process.env.GITHUB_WORKSPACE}/packages/${path}/package.json`) | |
| github.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: context.sha, | |
| state: 'success', | |
| context: `Published ${package.name}`, | |
| description: package.version, | |
| target_url: `https://unpkg.com/${package.name}@${package.version}/` | |
| }) | |
| }) |