Build for HTML5 #9
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: Build for HTML5 | |
on: workflow_dispatch | |
env: | |
GODOT_VERSION: 3.5.2 | |
EXPORT_NAME: neomugen | |
CARGO_TERM_COLOR: always | |
EMSDK_VERSION: 3.1.21 | |
jobs: | |
export-html: | |
name: HTML5 export | |
runs-on: ubuntu-latest | |
container: | |
image: barichello/godot-ci:3.5.2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get mugen data | |
run: | | |
wget https://f000.backblazeb2.com/file/jefersondaniel-public/mugen/neo-mugen-default-data.zip | |
unzip neo-mugen-default-data.zip && rm neo-mugen-default-data.zip | |
- name: Setup godot templates | |
run: | | |
mkdir -v -p ~/.local/share/godot/templates | |
mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable | |
- name: Install emscripten rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-11-10 | |
target: wasm32-unknown-emscripten | |
profile: minimal | |
- name: Install build essentials | |
run: apt-get update && apt-get install -y --no-install-recommends build-essential clang python3 xz-utils | |
- name: Setup emscripten sdk | |
uses: mymindstorm/setup-emsdk@v10 | |
with: | |
version: ${{env.EMSDK_VERSION}} | |
- name: Compile native lib for wasm | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: nightly-2023-11-10 | |
command: build | |
args: --manifest-path source/native/Cargo.toml --target wasm32-unknown-emscripten --release | |
env: | |
C_INCLUDE_PATH: ${{env.EMSDK}}/upstream/emscripten/cache/sysroot/include/ | |
CARGO_TARGET_DIR: source/native/target | |
- name: Build | |
run: | | |
mkdir -v -p exports/web | |
godot -v --export "HTML5" exports/web/${EXPORT_NAME}.html | |
- name: Publish Game | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./exports/web |