-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (84 loc) · 2.71 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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 && nix develop --command cargo build -Zbuild-std=std,panic_abort --target wasm32-unknown-emscripten --release
- name: Move artifacts
run: |
mkdir -v -p ./extern/{release,debug}
cp ./rust/godot-neural-networks/target/wasm32-unknown-emscripten/release/godot_neural_networks.wasm ./extern/release
cp ./rust/godot-neural-networks/target/debug/libgodot_neural_networks.so ./extern/debug
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: godot-neural-networks-wasm
path: ./extern
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
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: godot-neural-networks-wasm
path: ./game/extern
- 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: Raw Build
uses: actions/upload-artifact@v3
with:
name: godot-web
path: ./game
- name: Web Build
run: |
cd ./game
mkdir -v -p build/web
godot --headless --verbose --export-release "Web" build/web/index.html
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 }}