Skip to content

chore(deps): bump the cargo group with 3 updates (#82) #45

chore(deps): bump the cargo group with 3 updates (#82)

chore(deps): bump the cargo group with 3 updates (#82) #45

Workflow file for this run

---
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@9bb56186c3b09b4f86b1c65136769dd318469633
- 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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
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@b23c83949ccaee05b69f67e606215c7a9789fa54
with:
tool: wasm-pack
checksum: true
- name: build wasmplayer
run: |
wasm-pack build --release --target web
- name: upload wasmplayer
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
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@9bb56186c3b09b4f86b1c65136769dd318469633
- name: download wasmplayer
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
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@373f7f263a76c20808c831209c920827a82a2847
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: wasmplayer/