Skip to content

Commit 7c85d36

Browse files
committed
npm publish action
1 parent e84c161 commit 7c85d36

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/npm-publish.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish npm packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write # Required for npm OIDC provenance
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: false # Don't cancel publishing in progress
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: 'latest'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Clean
36+
run: pnpm run clean
37+
38+
- name: Install dependencies (after clean)
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Build packages
42+
run: pnpm build:packages
43+
44+
- name: Publish packages
45+
# pnpm publish skips versions that already exist on npm by default
46+
run: pnpm publish -r --no-git-checks
47+
env:
48+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)