Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm package #57

Merged
merged 7 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
- run: git checkout -B pr_check
- run: rustup component add clippy
- run: cargo install cargo-release
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: cargo test --verbose -- --nocapture
- run: wasm-pack test --headless --firefox ./adana-script-wasm
- run: wasm-pack test --headless --chrome ./adana-script-wasm
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo release --no-publish --no-tag --allow-branch pr_check --no-push --dependent-version upgrade minor
#- run: cargo publish --dry-run
47 changes: 47 additions & 0 deletions .github/workflows/release-wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release WASM

on:
push:
tags:
- "**[0-9]+.[0-9]+.[0-9]+*"

env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
- name: Build
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack build --target web --release --scope nbittich ./adana-script-wasm
wasm-pack pack ./adana-script-wasm/pkg
- name: Upload pkg
uses: actions/upload-artifact@v4
with:
name: pkg
path: adana-script-wasm/pkg
publish:
runs-on: ubuntu-latest
steps:
- name: Download pkg
uses: actions/download-artifact@v4
with:
name: pkg
path: pkg
- name: Setup NPM
uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Publish on NPM
run: npm publish pkg/nbittich-adana-script-wasm-${{github.ref_name}}.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
200 changes: 191 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading