chore(deps): bump the cargo group with 4 updates #62
Workflow file for this run
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
--- | |
name: ci/cd | |
"on": | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- LICENSE | |
- README.md | |
- fly.toml | |
- '.github/workflows/*' | |
- '.github/dependabot.yaml' | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- LICENSE | |
- README.md | |
- fly.toml | |
- '.github/workflows/*' | |
- '.github/dependabot.yaml' | |
jobs: | |
build: | |
name: build wasmplayer | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: checkout project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: rust stable latest | |
id: rust | |
run: | | |
latest="$(curl -sL https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name)" | |
echo "rust stable latest: ${latest}" | |
echo "stable_latest=${latest}" >> "$GITHUB_OUTPUT" | |
used="$(cargo --version | awk '{print $2}')" | |
echo "rust stable used: ${used}" | |
echo "stable_used=${used}" >> "$GITHUB_OUTPUT" | |
- name: check cache | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a | |
id: cache | |
with: | |
path: | | |
~/.cargo/ | |
~/.rustup/ | |
target/ | |
key: ${{ runner.os }}-rust-${{ steps.rust.outputs.stable_latest }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} | |
- name: update toolchain | |
if: steps.rust.outputs.stable_latest != steps.rust.outputs.stable_used | |
run: | | |
rustup update stable | |
- name: cargo fmt | |
run: | | |
cargo fmt -- --check --verbose | |
- name: cargo clippy | |
run: | | |
cargo clippy --locked --workspace | |
- name: install wasm-pack | |
uses: taiki-e/install-action@678b06b887cdbf44fa0601e5915f865e17c2241d | |
with: | |
tool: wasm-pack | |
checksum: true | |
- name: build wasmplayer | |
run: | | |
wasm-pack build --release --target web -- --features "bulk-memory" | |
- name: upload wasmplayer | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
with: | |
name: wasmplayer | |
path: pkg/ | |
if-no-files-found: error | |
retention-days: 1 | |
deploy: | |
name: deploy wasmplayer | |
needs: build | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: checkout project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: download wasmplayer | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 | |
with: | |
name: wasmplayer | |
path: pkg/ | |
- name: prepare wasmplayer | |
run: | | |
set -x | |
mkdir -p wasmplayer/pkg/ | |
mv pkg/wasmplayer.js \ | |
pkg/wasmplayer_bg.wasm \ | |
wasmplayer/pkg/ | |
mv assets/ \ | |
index.html \ | |
wasmplayer/ | |
- name: publish to gh-pages | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: wasmplayer/ |