-
Notifications
You must be signed in to change notification settings - Fork 34
55 lines (49 loc) · 1.53 KB
/
release-wasm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Release WebAssembly
on:
push:
tags:
- "v*"
jobs:
npm:
name: NPM Build & Publish
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Cache files between builds
- name: Setup | Cache Cargo
uses: actions/[email protected]
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: wasm-build-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup | Rust
uses: actions-rs/[email protected]
with:
toolchain: nightly
override: true
profile: minimal
target: x86_64-unknown-linux-gnu
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install binaryen
run: |
set -e
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_114/binaryen-version_114-x86_64-linux.tar.gz | tar xzf -
echo "`pwd`/binaryen-version_114/bin" > $GITHUB_PATH
- name: Publish NPM for Bundler
run: |
git config advice.addIgnoredFile false
echo $(git describe --abbrev=0 --tags | sed "s/^v//")
make wasm:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}