Skip to content

Commit 90c0363

Browse files
Add GitHub Actions workflow for publishing NPM packages
1 parent 4af207e commit 90c0363

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/publish-npm.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish NPM Packages
2+
3+
on:
4+
release:
5+
types: [published] # triggers when a release is published on GitHub
6+
workflow_dispatch: # allows manual trigger from the Actions tab
7+
8+
jobs:
9+
publish:
10+
name: Build, Test & Publish to NPM
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: platform/packages
15+
16+
permissions:
17+
contents: read
18+
id-token: write # required for npm provenance
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
run_install: false
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '24'
33+
registry-url: 'https://registry.npmjs.org'
34+
cache: 'pnpm'
35+
cache-dependency-path: framework/platform/packages/pnpm-lock.yaml
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build all packages
41+
run: pnpm build
42+
43+
- name: Run tests
44+
run: pnpm test
45+
46+
- name: Publish all packages to NPM
47+
run: pnpm -r publish --access public --no-git-checks
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Release and Deploy
66

77
on:
88
release:
9-
types: [ created ]
9+
types: [ published ]
1010

1111
jobs:
1212
build:

0 commit comments

Comments
 (0)