Skip to content

chore(deps): bump the cargo group with 2 updates #67

chore(deps): bump the cargo group with 2 updates

chore(deps): bump the cargo group with 2 updates #67

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@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@1bd1e32a3bdc45362d1e726936510720a7c30a57
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@acd25891978b4cdaebd139d3efef606d26513b14
with:
tool: wasm-pack
checksum: true
- name: build wasmplayer
run: |
wasm-pack build --release --target web --no-opt
- name: upload wasmplayer
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
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/