@@ -2,15 +2,107 @@ name: Release
22
33on :
44 push :
5- branches :
6- - main
7- - next-minor
5+
6+ concurrency :
7+ group : ${{ github.workflow }}-${{ github.ref }}
8+ cancel-in-progress : true
9+
10+ permissions :
11+ id-token : write # Required for OIDC
12+ contents : read
13+ checks : write
14+ statuses : write
815
916jobs :
10- release :
17+ release-main :
1118 if : github.ref_name == 'main'
12- name : Release
13- uses : primer/.github/.github/workflows/release.yml@v1.0.0
19+ name : Main
20+ uses : primer/.github/.github/workflows/release.yml@v2.3.1
1421 secrets :
1522 gh_token : ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
16- npm_token : ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
23+
24+ release-candidate :
25+ if : ${{ github.repository == 'primer/doctocat-nextjs' && github.ref_name == 'changeset-release/main' }}
26+ name : Candidate
27+ runs-on : ubuntu-latest
28+ steps :
29+ - name : Checkout repository
30+ uses : actions/checkout@v5
31+ with :
32+ # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
33+ fetch-depth : 0
34+
35+ - name : Set up Node
36+ uses : actions/setup-node@v6
37+ with :
38+ node-version : 24
39+
40+ - name : Install dependencies
41+ run : npm ci
42+
43+ - name : Publish release candidate
44+ run : |
45+ npm exec --workspaces -- ../../packages/repo-configs/scripts/prepare-release-candidate
46+ npx changeset publish --tag next
47+ env :
48+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49+
50+ - name : Output canary version
51+ uses : actions/github-script@v4.0.2
52+ with :
53+ script : |
54+ const paths = ['theme'].forEach((path) => {
55+ const package = require(`${process.env.GITHUB_WORKSPACE}/packages/${path}/package.json`)
56+ github.repos.createCommitStatus({
57+ owner: context.repo.owner,
58+ repo: context.repo.repo,
59+ sha: context.sha,
60+ state: 'success',
61+ context: `Published ${package.name}`,
62+ description: package.version,
63+ target_url: `https://unpkg.com/${package.name}@${package.version}/`
64+ })
65+ })
66+
67+ release-canary :
68+ if : ${{ github.repository == 'primer/doctocat-nextjs' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' }}
69+ name : Canary
70+ runs-on : ubuntu-latest
71+ steps :
72+ - name : Checkout repository
73+ uses : actions/checkout@v5
74+ with :
75+ # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
76+ fetch-depth : 0
77+
78+ - name : Set up Node
79+ uses : actions/setup-node@v6
80+ with :
81+ node-version : 24
82+
83+ - name : Install dependencies
84+ run : npm ci
85+
86+ - name : Publish canary release
87+ run : |
88+ npm exec --workspaces -- ../../packages/repo-configs/scripts/prepare-canary
89+ npx changeset publish --tag canary
90+ env :
91+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92+
93+ - name : Output canary version
94+ uses : actions/github-script@v4.0.2
95+ with :
96+ script : |
97+ const paths = ['theme'].forEach((path) => {
98+ const package = require(`${process.env.GITHUB_WORKSPACE}/packages/${path}/package.json`)
99+ github.repos.createCommitStatus({
100+ owner: context.repo.owner,
101+ repo: context.repo.repo,
102+ sha: context.sha,
103+ state: 'success',
104+ context: `Published ${package.name}`,
105+ description: package.version,
106+ target_url: `https://unpkg.com/${package.name}@${package.version}/`
107+ })
108+ })
0 commit comments