Skip to content

chore(deps): bump the cargo group with 4 updates (#72) #43

chore(deps): bump the cargo group with 4 updates (#72)

chore(deps): bump the cargo group with 4 updates (#72) #43

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@b4ffde65f46336ab88eb53be808477a3936bae11
- 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"
echo "rust stable used: ${used}"
used="$(cargo --version | awk '{print $2}')"
echo "stable_used=${used}" >> "$GITHUB_OUTPUT"
- name: check cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
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@b7add58e53e52e624966da65007ce24524f3dcf3
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@b4ffde65f46336ab88eb53be808477a3936bae11
- name: download wasmplayer
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe
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/