chore: Release #64
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: Server Release | |
on: | |
push: | |
tags: | |
- jornet-server-v** | |
- jornet-ui-v** | |
- bevy_jornet-v** | |
jobs: | |
Release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
target: wasm32-unknown-unknown | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: setup git | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email [email protected] | |
git checkout -b release-clever | |
- name: install tools | |
run: | | |
cargo install wasm-bindgen-cli | |
sudo apt-get install -y binaryen | |
- name: build wasm demo | |
run: | | |
# temp fix for https://github.com/bevyengine/bevy/issues/5426 | |
echo '[patch.crates-io]' >> Cargo.toml | |
echo 'wgpu = { git = "https://github.com/mockersf/wgpu/", branch = "unconditional-clear-workaround" }' >> Cargo.toml | |
cargo build --profile wasm-release --target wasm32-unknown-unknown --example whac-a-square | |
wasm-bindgen --out-dir wasm --out-name demo_leaderboard --target web target/wasm32-unknown-unknown/wasm-release/examples/whac-a-square.wasm | |
wasm-opt -Oz wasm/demo_leaderboard_bg.wasm --output wasm/demo_leaderboard_bg-opt.wasm | |
cp -r bevy-jornet/assets jornet-server-ui/public/ | |
cp wasm/demo_leaderboard_bg-opt.wasm jornet-server-ui/public/demo_leaderboard_bg.wasm | |
cp wasm/demo_leaderboard.js jornet-server-ui/public/ | |
# remove temp patch | |
git restore Cargo.toml | |
env: | |
JORNET_LEADERBOARD_ID: ${{ secrets.JORNET_LEADERBOARD_ID }} | |
JORNET_LEADERBOARD_KEY: ${{ secrets.JORNET_LEADERBOARD_KEY }} | |
- name: remove other crates to reduce dependencies | |
run: | | |
rm -rf bevy-jornet | |
cargo new --lib bevy-jornet | |
rm -rf jornet-cli | |
cargo new --lib jornet-cli | |
cargo update --workspace | |
git add bevy-jornet | |
git add jornet-cli | |
git add Cargo.lock | |
git commit --message "remove other crates" | |
- name: build front | |
run: | | |
cd jornet-server-ui | |
npm install | |
npm run build | |
cp -r build ../static | |
git add ../static | |
git commit --message "Built front" | |
- name: push branch | |
run: | | |
git push --force origin release-clever | |
- uses: 47ng/[email protected] | |
with: | |
appID: app_451f9750-246e-4649-b419-7f3888fa2c69 | |
force: true | |
env: | |
CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }} | |
CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }} |