-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: NPM Release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
npm: | ||
name: NPM Build & Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Cache files between builds | ||
- name: Setup | Cache Cargo | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: npm-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 & wasm-opt | ||
run: | | ||
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
sudo apt-get install binaryen | ||
- name: Publish NPM | ||
run: | | ||
echo $(git describe --abbrev=0 --tags | sed "s/^v//") | ||
make wasm:publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,3 +143,39 @@ jobs: | |
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
npm: | ||
runs-on: ubuntu-latest | ||
needs: github_release | ||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/[email protected] | ||
|
||
# Cache files between builds | ||
- name: Setup | Cache Cargo | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: npm-build-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Setup | Rust | ||
uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
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: Setup wasm-pack | ||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
|
||
- name: Publish NPM | ||
run: make wasm:publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters