Skip to content

Commit 200867b

Browse files
ci: add npm publish dry-run to preflight
Uses NPM_TOKEN to validate publish flow without releasing. Signed-off-by: night-slayer18 <samanuaia257@gmail.com>
1 parent 593ab2a commit 200867b

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/preflight.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Preflight Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
- main
9+
10+
jobs:
11+
preflight:
12+
name: Preflight checks
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 20
15+
env:
16+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
17+
steps:
18+
- uses: actions/checkout@v6
19+
with:
20+
fetch-depth: 0
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v6
23+
with:
24+
node-version: 22
25+
cache: npm
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Build packages
29+
run: npm run build
30+
- name: Type check
31+
run: npm run type-check
32+
- name: Lint
33+
run: npm run lint
34+
- name: Test
35+
run: npm run test
36+
- name: Pack publishable packages
37+
run: |
38+
npm -w packages/core pack
39+
npm -w packages/cli pack
40+
npm -w packages/plugins/markdown pack
41+
npm -w packages/plugins/examples pack
42+
rm -f opensyntaxhq-*.tgz
43+
- name: Publish dry-run (requires NPM_TOKEN)
44+
if: ${{ env.NPM_TOKEN != '' }}
45+
env:
46+
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
47+
run: |
48+
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
49+
npm -w packages/core publish --dry-run
50+
npm -w packages/cli publish --dry-run
51+
npm -w packages/plugins/markdown publish --dry-run
52+
npm -w packages/plugins/examples publish --dry-run

0 commit comments

Comments
 (0)