Update github dependencies #24
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: Godot Export | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "README.md" | |
- ".gitattributes" | |
- ".gitignore" | |
env: | |
GODOT_VERSION: 4.3 | |
jobs: | |
build-wasm: | |
name: Build WASM | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Build Rust | |
run: cd ./rust/godot-neural-networks && nix develop --command cargo build -Zbuild-std=std,panic_abort --target wasm32-unknown-emscripten --release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: godot-neural-networks-wasm | |
path: ./rust/godot-neural-networks/target/wasm32-unknown-emscripten/release/godot_neural_networks.wasm | |
export-web: | |
name: Web Export | |
runs-on: ubuntu-20.04 | |
needs: | |
- build-wasm | |
container: | |
image: barichello/godot-ci:4.3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Make dir | |
run: mkdir -v -p ./game/extern/release | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: godot-neural-networks-wasm | |
path: ./game/extern/release/godot-neural-networks.wasm | |
- name: Setup Godot Template | |
run: | | |
mkdir -v -p ~/.local/share/godot/export_templates | |
mkdir -v -p ~/.config/ | |
mv /root/.config/godot ~/.config/godot | |
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable | |
ls -lah | |
- name: List files | |
run: | | |
ls -lah | |
- name: Web Build | |
run: | | |
cd ./game | |
mkdir -v -p build/web | |
godot --headless --verbose --export-release "Web" ../exports/ | |
ls -lah build/web | |
- name: Netlify headers | |
run: | | |
cat <<EOF > build/web/_headers | |
/* | |
Cross-Origin-Opener-Policy: same-origin | |
Cross-Origin-Embedder-Policy: require-corp | |
Access-Control-Allow-Origin: * | |
EOF | |
cat build/web/_headers | |
- name: Deploy artifacts to `artifacts` branch | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: gh-pages | |
FOLDER: ./build/web | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |