diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..659865b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release +on: + release: + types: + - created + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + id: install-stable + with: + toolchain: stable + default: true + - name: Cargo cache + uses: actions/cache@v3 + with: + key: v1-${{ runner.os }}-cargo-${{ steps.install-stable.outputs.rustc_hash }}-${{ steps.install-nightly.outputs.rustc_hash }}-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }} + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/cargo-install/ + target/debug/ + target/wasm32-unknown-unknown/ + target/.rustc_info.json + target/CACHEDIR.TAG + restore-keys: | + v1-${{ runner.os }}-cargo-${{ steps.install-stable.outputs.rustc_hash }}-${{ steps.install-nightly.outputs.rustc_hash }}-refs/heads/master-${{ hashFiles('**/Cargo.lock') }} + v1-${{ runner.os }}-cargo-${{ steps.install-stable.outputs.rustc_hash }}-${{ steps.install-nightly.outputs.rustc_hash }}-refs/heads/master- + v1-${{ runner.os }}-cargo-${{ steps.install-stable.outputs.rustc_hash }}-${{ steps.install-nightly.outputs.rustc_hash }}- + v1-${{ runner.os }}-cargo-${{ steps.install-stable.outputs.rustc_hash }}- + - name: Install CLI deps + run: cargo install --force --debug --target-dir target/cargo-install wasm-pack + - name: Test (stable, no features) + run: wasm-pack test --headless --firefox --chrome --locked --no-default-features + - name: Test (stable, all features) + run: wasm-pack test --headless --firefox --chrome --locked + - name: List package contents + run: cargo package --list --locked --target wasm32-unknown-unknown + - name: Release + run: cargo publish --target wasm32-unknown-unknown --locked --token ${{ secrets.CRATES_IO_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f7fb31..c17112e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,6 +56,8 @@ jobs: run: cargo install --force --debug --target-dir target/cargo-install wasm-pack - name: Test (stable, no features) run: wasm-pack test --headless --firefox --chrome --locked --no-default-features + - name: Test (stable, all features) + run: wasm-pack test --headless --firefox --chrome --locked - name: Test (nightly, no features) run: rustup run nightly wasm-pack test --headless --firefox --chrome --locked --no-default-features --features nightly - name: Test (nightly, all features)