Skip to content

Commit 5dff53d

Browse files
authored
ci: add npm publish workflow for wasm packages (#274)
1 parent 6f65c30 commit 5dff53d

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish npm
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-24.04
15+
timeout-minutes: 15
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
# trusted publishing requires npm >= 11.5.1
22+
node-version: 24
23+
registry-url: "https://registry.npmjs.org"
24+
25+
- run: rustup update stable && rustup default stable
26+
27+
- name: Install wasm-pack
28+
run: cargo install wasm-pack@0.13.1 --locked
29+
30+
- run: wasm-pack build crates/signed_note_wasm --target web --scope cloudflare
31+
- run: wasm-pack build crates/tlog_tiles_wasm --target web --scope cloudflare
32+
33+
- name: Rename packages to kebab-case
34+
run: |
35+
npm pkg set name=@cloudflare/signed-note-wasm --prefix crates/signed_note_wasm/pkg
36+
npm pkg set name=@cloudflare/tlog-tiles-wasm --prefix crates/tlog_tiles_wasm/pkg
37+
38+
- run: npm publish --access public
39+
working-directory: crates/signed_note_wasm/pkg
40+
41+
- run: npm publish --access public
42+
working-directory: crates/tlog_tiles_wasm/pkg

0 commit comments

Comments
 (0)