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
# References from 2shady4u/godot-cpp-ci | |
name: "Github Pages" | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
GODOT_VERSION: 4.3 | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- run: cargo llvm-cov --html --all-features --workspace | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rust-coverage | |
path: target/llvm-cov/html | |
wasm-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- uses: mymindstorm/setup-emsdk@v14 | |
with: | |
# pinned by godot/gdextension. | |
version: 3.1.39 | |
actions-cache-folder: emsdk-cache | |
- run: emcc -v | |
- name: build wasm library | |
run: | | |
rustup toolchain install nightly | |
rustup component add rust-src --toolchain nightly | |
rustup target add wasm32-unknown-emscripten --toolchain nightly | |
cargo +nightly build -Zbuild-std --target wasm32-unknown-emscripten | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: glue-library | |
path: target/**/godot_glue.wasm | |
if-no-files-found: error | |
godot-web-export: | |
runs-on: ubuntu-latest | |
needs: [ wasm-build ] | |
container: | |
image: barichello/godot-ci:4.3 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Write Commit Hash | |
run: | | |
git config --global --add safe.directory "*" | |
git log -1 --format=reference > godot/ci-version.txt | |
- uses: actions/download-artifact@v4 | |
with: | |
name: glue-library | |
path: target | |
- run: ls -R target | |
- run: bash ./.github/preprocess-gdscript.sh | |
working-directory: . | |
- name: Godot Web Export | |
run: | | |
mkdir -v -p ~/.local/share/godot/export_templates/ | |
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable | |
mkdir -v -p build/web | |
godot -v --headless --path godot/ --export-debug "Web" ../build/web/index.html | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: godot-web-export | |
path: build/web | |
if-no-files-found: error | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [ coverage, godot-web-export ] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: rust-coverage | |
path: build/coverage | |
- uses: actions/download-artifact@v4 | |
with: | |
name: godot-web-export | |
path: build/ | |
- name: Deploy to GitHub Pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: build/ | |
single-commit: true |