@@ -13,8 +13,8 @@ permissions:
1313 id-token : write
1414
1515jobs :
16- release :
17- name : Release
16+ build :
17+ name : Build Library
1818 runs-on : ubuntu-latest
1919 steps :
2020 - name : Checkout code
@@ -30,29 +30,175 @@ jobs:
3030 with :
3131 node-version : 20
3232 cache : " pnpm"
33- registry-url : " https://registry.npmjs.org"
3433
3534 - name : Install dependencies
3635 run : pnpm install --frozen-lockfile
3736
38- - name : Build package
37+ - name : Build library
3938 run : pnpm build
4039
40+ - name : Upload build artifacts
41+ uses : actions/upload-artifact@v4
42+ with :
43+ name : dist
44+ path : dist
45+ retention-days : 1
46+
47+ lint :
48+ name : Lint Library
49+ runs-on : ubuntu-latest
50+ steps :
51+ - name : Checkout code
52+ uses : actions/checkout@v4
53+
54+ - name : Setup pnpm
55+ uses : pnpm/action-setup@v4
56+ with :
57+ version : 9
58+
59+ - name : Setup Node.js
60+ uses : actions/setup-node@v4
61+ with :
62+ node-version : 20
63+ cache : " pnpm"
64+
65+ - name : Install dependencies
66+ run : pnpm install --frozen-lockfile
67+
68+ - name : Run ESLint
69+ run : pnpm lint
70+
71+ typecheck :
72+ name : Type Check Library
73+ runs-on : ubuntu-latest
74+ steps :
75+ - name : Checkout code
76+ uses : actions/checkout@v4
77+
78+ - name : Setup pnpm
79+ uses : pnpm/action-setup@v4
80+ with :
81+ version : 9
82+
83+ - name : Setup Node.js
84+ uses : actions/setup-node@v4
85+ with :
86+ node-version : 20
87+ cache : " pnpm"
88+
89+ - name : Install dependencies
90+ run : pnpm install --frozen-lockfile
91+
4192 - name : Run TypeScript type checking
4293 run : pnpm typecheck
4394
44- - name : Run linting
45- run : pnpm lint
95+ unit-tests :
96+ name : Unit Tests
97+ runs-on : ubuntu-latest
98+ steps :
99+ - name : Checkout code
100+ uses : actions/checkout@v4
101+
102+ - name : Setup pnpm
103+ uses : pnpm/action-setup@v4
104+ with :
105+ version : 9
106+
107+ - name : Setup Node.js
108+ uses : actions/setup-node@v4
109+ with :
110+ node-version : 20
111+ cache : " pnpm"
112+
113+ - name : Install dependencies
114+ run : pnpm install --frozen-lockfile
46115
47116 - name : Run unit tests
48117 run : pnpm test:unit
49118
119+ example-lint :
120+ name : Lint Example App
121+ runs-on : ubuntu-latest
122+ steps :
123+ - name : Checkout code
124+ uses : actions/checkout@v4
125+
126+ - name : Setup pnpm
127+ uses : pnpm/action-setup@v4
128+ with :
129+ version : 9
130+
131+ - name : Setup Node.js
132+ uses : actions/setup-node@v4
133+ with :
134+ node-version : 20
135+ cache : " pnpm"
136+
137+ - name : Install dependencies
138+ run : pnpm install --frozen-lockfile
139+
50140 - name : Lint example app
51141 run : pnpm example:lint
52142
143+ example-typecheck :
144+ name : Type Check Example App
145+ runs-on : ubuntu-latest
146+ needs : build
147+ steps :
148+ - name : Checkout code
149+ uses : actions/checkout@v4
150+
151+ - name : Setup pnpm
152+ uses : pnpm/action-setup@v4
153+ with :
154+ version : 9
155+
156+ - name : Setup Node.js
157+ uses : actions/setup-node@v4
158+ with :
159+ node-version : 20
160+ cache : " pnpm"
161+
162+ - name : Install dependencies
163+ run : pnpm install --frozen-lockfile
164+
165+ - name : Download build artifacts
166+ uses : actions/download-artifact@v4
167+ with :
168+ name : dist
169+ path : dist
170+
53171 - name : Type check example app
54172 run : pnpm example:typecheck
55173
174+ e2e-tests :
175+ name : E2E Tests
176+ runs-on : ubuntu-latest
177+ needs : build
178+ steps :
179+ - name : Checkout code
180+ uses : actions/checkout@v4
181+
182+ - name : Setup pnpm
183+ uses : pnpm/action-setup@v4
184+ with :
185+ version : 9
186+
187+ - name : Setup Node.js
188+ uses : actions/setup-node@v4
189+ with :
190+ node-version : 20
191+ cache : " pnpm"
192+
193+ - name : Install dependencies
194+ run : pnpm install --frozen-lockfile
195+
196+ - name : Download build artifacts
197+ uses : actions/download-artifact@v4
198+ with :
199+ name : dist
200+ path : dist
201+
56202 - name : Build example app
57203 run : pnpm example:build
58204
@@ -64,6 +210,47 @@ jobs:
64210 env :
65211 CI : true
66212
213+ release :
214+ name : Create Release PR or Publish
215+ runs-on : ubuntu-latest
216+ needs :
217+ [
218+ build,
219+ lint,
220+ typecheck,
221+ unit-tests,
222+ example-lint,
223+ example-typecheck,
224+ e2e-tests,
225+ ]
226+ outputs :
227+ published : ${{ steps.changesets.outputs.published }}
228+ publishedPackages : ${{ steps.changesets.outputs.publishedPackages }}
229+ steps :
230+ - name : Checkout code
231+ uses : actions/checkout@v4
232+
233+ - name : Setup pnpm
234+ uses : pnpm/action-setup@v4
235+ with :
236+ version : 9
237+
238+ - name : Setup Node.js
239+ uses : actions/setup-node@v4
240+ with :
241+ node-version : 20
242+ cache : " pnpm"
243+ registry-url : " https://registry.npmjs.org"
244+
245+ - name : Install dependencies
246+ run : pnpm install --frozen-lockfile
247+
248+ - name : Download build artifacts
249+ uses : actions/download-artifact@v4
250+ with :
251+ name : dist
252+ path : dist
253+
67254 - name : Create Release Pull Request or Publish
68255 id : changesets
69256 uses : changesets/action@v1
@@ -77,8 +264,13 @@ jobs:
77264 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
78265 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
79266
80- - name : Post Release Actions
81- if : steps.changesets.outputs.published == 'true'
267+ post-release :
268+ name : Post Release Actions
269+ runs-on : ubuntu-latest
270+ needs : release
271+ if : needs.release.outputs.published == 'true'
272+ steps :
273+ - name : Report Released Packages
82274 run : |
83275 echo "🎉 Released packages:"
84- echo "${{ steps.changesets .outputs.publishedPackages }}"
276+ echo "${{ needs.release .outputs.publishedPackages }}"
0 commit comments