Skip to content

Commit b5586e7

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 b5586e7

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/preflight.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: 22
23+
cache: npm
24+
- name: Install dependencies
25+
run: npm ci
26+
- name: Build packages
27+
run: npm run build
28+
- name: Type check
29+
run: npm run type-check
30+
- name: Lint
31+
run: npm run lint
32+
- name: Test
33+
run: npm run test
34+
- name: Pack publishable packages
35+
run: |
36+
npm -w packages/core pack
37+
npm -w packages/cli pack
38+
npm -w packages/plugins/markdown pack
39+
npm -w packages/plugins/examples pack
40+
rm -f opensyntaxhq-*.tgz
41+
- name: Publish dry-run (requires NPM_TOKEN)
42+
if: ${{ secrets.NPM_TOKEN != '' }}
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
run: |
46+
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
47+
npm -w packages/core publish --dry-run
48+
npm -w packages/cli publish --dry-run
49+
npm -w packages/plugins/markdown publish --dry-run
50+
npm -w packages/plugins/examples publish --dry-run

0 commit comments

Comments
 (0)