Skip to content

Commit 6b7c2b4

Browse files
committed
Add npm publish CI workflow (#57)
Also upgrade to node 22, which bundles latest npm, to fix npm/cli#7564.
1 parent d83de82 commit 6b7c2b4

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
npm:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
id-token: write
13+
14+
steps:
15+
- name: Checkout the commit
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
registry-url: 'https://registry.npmjs.org/'
22+
node-version-file: '.nvmrc'
23+
cache: 'npm'
24+
25+
- name: Setup turbo cache
26+
uses: actions/cache@v4
27+
with:
28+
path: node_modules/.cache/turbo
29+
key: ${{ runner.os }}-turbo-${{ github.sha }}
30+
restore-keys: |
31+
${{ runner.os }}-turbo-
32+
33+
- name: Install dependencies
34+
run: npm install
35+
36+
- name: Publish to npm
37+
run: npm publish --workspaces --provenance --access public
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22.3.0

0 commit comments

Comments
 (0)