Skip to content

Commit

Permalink
ci: Set up release
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Dec 3, 2022
1 parent ce67957 commit e72e67a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e72e67a

Please sign in to comment.