Skip to content

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

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

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

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"
- 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: cargo fmt
run: |
cargo fmt -- --check --verbose
- name: cargo clippy
run: |
cargo clippy --locked --workspace
- name: install wasm-pack
uses: taiki-e/install-action@bee85d7ea77c01f7a403c22ac2c802b431b093df
with:
tool: wasm-pack
checksum: true
- name: build wasmplayer
run: |
wasm-pack build --release --target web
- name: upload wasmplayer
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
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@6b208ae046db98c579e8a3aa621ab581ff575935
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/