Web #58
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: Web | |
on: | |
create: | |
workflow_dispatch: | |
# push: | |
# branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
APP_NAME: ethertia | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, rust-src, clippy | |
- name: Install Dependencies | |
run: | | |
rustup target add wasm32-unknown-unknown | |
cargo install -f wasm-bindgen-cli --version 0.2.91 | |
# sudo apt install binaryen # install for wasm-opt | |
- name: Build for WASM | |
run: | | |
cargo build --profile web-release --target wasm32-unknown-unknown --no-default-features --bin ethertia | |
wasm-bindgen --no-typescript --out-dir ./build/wasm --target web target/wasm32-unknown-unknown/web-release/ethertia.wasm --out-name ethertia | |
# wasm-opt -Oz -o ./build/wasm/ethertia_opt.wasm ./build/wasm/ethertia_bg.wasm | |
- name: Zip Artifact | |
run: | | |
cp -r assets ./build/wasm/ | |
zip --recurse-paths ethertia-wasm.zip ./build/wasm/ | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: | | |
./ethertia-wasm.zip | |
# - name: Create Release | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ github.ref }} | |
# release_name: Release ${{ github.ref }} | |
# body: | | |
# This is the release of ${APP_NAME}. | |
# draft: false | |
# prerelease: true | |