Skip to content

Commit 67adfd2

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 67adfd2

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- name: Checkout the commit
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
registry-url: 'https://registry.npmjs.org/'
23+
node-version-file: '.nvmrc'
24+
cache: 'npm'
25+
26+
- name: Setup turbo cache
27+
uses: actions/cache@v4
28+
with:
29+
path: node_modules/.cache/turbo
30+
key: ${{ runner.os }}-turbo-${{ github.sha }}
31+
restore-keys: |
32+
${{ runner.os }}-turbo-
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Publish to npm
38+
run: npm publish --workspaces --provenance --access public
39+
env:
40+
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)