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

Split build-crate-and-npm and rename build-test #690

Merged
merged 2 commits into from
Aug 28, 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
71 changes: 0 additions & 71 deletions .github/workflows/build-crate-and-npm.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/build-crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Rust crate

on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- "**"

jobs:
build_crate:
name: Build crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Fmt
run: cargo fmt -- --files-with-diff --check

- name: Clippy
run: cargo clippy

- name: Tests
run: cargo test && cargo test --release

- name: Build
run: cargo build --release

- name: Upload crate artifacts
uses: actions/upload-artifact@v4
with:
name: crate
path: ./target/package/*-*.crate

- name: Publish (crates.io)
if: startsWith(github.event.ref, 'refs/tags')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
run: |
cargo install cargo-workspaces --locked
cargo ws publish --publish-as-is
43 changes: 43 additions & 0 deletions .github/workflows/build-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: NPM package

on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- "**"

jobs:
build_npm:
name: Build npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Install wasm-pack
run: cargo install wasm-pack --locked

- name: WASM build and pack
run: |
cd wasm
wasm-pack build
wasm-pack pack
- name: Upload NPM pkg artifacts
uses: actions/upload-artifact@v4
with:
name: npm-pkg
path: ./wasm/pkg/*-*.tgz

- name: Publish (npmjs.com)
if: startsWith(github.event.ref, 'refs/tags')
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.node_auth_token }}
package: wasm/pkg/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build - check - upload
name: Python wheels

on:
push:
Expand Down
Loading