Use nix in github actions #16
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 | |
CC: gcc | |
jobs: | |
export-web: | |
name: Web Export | |
runs-on: ubuntu-20.04 | |
container: | |
image: barichello/godot-ci:4.3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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 | |
- uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Build Rust | |
run: nix develop --command cargo build -Zbuild-std=std,panic_abort --target wasm32-unknown-emscripten --release | |
# - name: Web Build | |
# run: | | |
# mkdir -v -p build/web | |
# godot --headless --verbose --export-release "Web" ../exports/ | |
# ls -lah build/web | |
# - name: Netlify headers | |
# # https://github.com/godotengine/godot/issues/69020 | |
# # https://github.com/godotengine/godot/blob/master/platform/web/serve.py | |
# # https://docs.netlify.com/routing/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 }} |