-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
239 lines (212 loc) · 5.77 KB
/
Taskfile.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# https://taskfile.dev
version: "3"
output: "prefixed"
vars:
APP_NAME:
sh: >-
{{if eq OS "linux"}}
echo "SuperIcosahedron-$(./scripts/get_version.sh --short)-$(./scripts/get_version.sh --tag)"
{{ end }}
BUILD_DIR:
sh: >-
{{if eq OS "linux"}}
echo "./build/$(./scripts/get_version.sh --tag)-$(./scripts/get_version.sh --short)"
{{ end }}
tasks:
default:
cmds:
- echo "run task -l or task --list-all to see all avaliable tasks"
silent: true
format-shaders:
desc: format all ".gdshader" files w/ clang-format
cmds:
- |
{{if eq OS "windows"}}
powershell -c '
$files=(git ls-files --exclude-standard); foreach ($file in $files) {
if ((get-item $file).Extension -in ".gdshader", ".gdshaderinc", ".glsl", ".glslv", ".glslf")
{ clang-format -i -style=file $file }
}'
{{else}}
git ls-files --exclude-standard |
grep -E '\.(gdshader|gdshaderinc|glsl|glslv|glslf)$' |
xargs clang-format -i -style=file
{{end}}
sources:
- "**/*.gdshader"
- "**/*.gdshaderinc"
check:
desc: run linters and formatters
aliases: [fmt]
deps:
- format-shaders
cmds:
- pre-commit run --all-files --color always
sources:
- ./*
gd-dev-build-web:
internal: true
cmds:
- rm -f ./build/web/* || true
- mkdir -p ./build/web
- godot --headless --export-debug "Web" ./build/web/index.html
dev-build-web:
platforms: [linux]
desc: build project for web
interactive: true
deps:
- check
- build-check
cmds:
- defer: { task: build-cleanup }
- task: gd-dev-build-web
gd-dev-build-windows:
internal: true
cmds:
- rm -f {{.BUILD_DIR}}/pc/*.exe || true
- mkdir -p {{.BUILD_DIR}}/pc
- >-
godot --headless --export-debug "Windows Desktop" --rendering-method forward_plus
{{.BUILD_DIR}}/pc/{{.APP_NAME}}-dev.exe
dev-build-windows:
platforms: [linux]
desc: build project for windows pc
deps:
- check
- build-check
cmds:
- defer: { task: build-cleanup }
- task: gd-dev-build-windows
gd-dev-build-linux:
internal: true
cmds:
- rm -f {{.BUILD_DIR}}/linux/*.x86_64 || true
- mkdir -p {{.BUILD_DIR}}/linux
- >-
godot --headless --export-debug "Linux/X11" --rendering-method forward_plus
{{.BUILD_DIR}}/linux/{{.APP_NAME}}-dev.x86_64
dev-build-linux:
platforms: [linux]
desc: build project for linux pc
interactive: true
deps:
- check
- build-check
cmds:
- defer: { task: build-cleanup }
- task: gd-dev-build-linux
gd-dev-build-android:
internal: true
cmds:
- rm -f {{.BUILD_DIR}}/android/*.apk || true
- mkdir -p {{.BUILD_DIR}}/android
- >-
godot --headless --export-debug "Android"
{{.BUILD_DIR}}/android/{{.APP_NAME}}-dev.apk
dev-build-android:
platforms: [linux]
desc: build project for android
interactive: true
deps:
- check
- build-check
cmds:
- defer: { task: build-cleanup }
- task: gd-dev-build-android
build-parallel:
internal: true
deps:
- gd-dev-build-web
- gd-dev-build-windows
- gd-dev-build-linux
- gd-dev-build-android
cmds:
- echo Build for app {{.APP_NAME}} completed
dev-build-all:
platforms: [linux]
desc: build for all platforms
interactive: true
aliases: [all]
deps:
- check
- build-check
cmds:
- defer: { task: build-cleanup }
- task: build-parallel
deploy-dev-internal:
internal: true
cmds:
- >-
ansible-playbook
./deploy/dev/deploy_local.yaml -l local_pi,
--verbose --vault-password-file ~/.ansible_vault_password
deploy-dev:
platforms: [linux]
desc: upload build files to file server
interactive: true
cmds:
- { task: deploy-dev-internal }
deploy-build-dev:
platforms: [linux]
aliases: [deploy]
desc: build for all platforms and upload files to file server
interactive: true
deps:
- dev-build-all
cmds:
- { task: deploy-dev-internal }
caddy:
desc: run reverce proxy to view web build and file server locally
preconditions:
- sh: type caddy
msg: caddy not found
cmds:
- caddy run --config ./deploy/dev/Caddyfile.local --watch --adapter caddyfile
build-check:
desc: run prebuild scripts
cmds:
- python ./scripts/on_build.py
- { task: gen-version-file }
build-cleanup:
desc: run afterbuild scripts
cmds:
- python ./scripts/on_build.py --cleanup
web-dev-server:
desc: start vite dev server
interactive: true
env:
VITE_GAME_VERSION: v0.0.0
VITE_GAME_COMMIT: taskbld01
VITE_HOST_URL: https://supericosahedron.localhost
VITE_OG_DESCRIPTION: Aboba
preconditions:
- sh: >-
{{if eq OS "linux"}}
test pnpm
{{ end }}
msg: pnpm not found
dir: web
cmds:
- pnpm i
- pnpm run dev
debug-web:
desc: run dev server and local reverse proxy for web
deps:
- caddy
- web-dev-server
cmds:
- echo "debug session ended"
pull-assets:
desc: download assets from the cloud
prompt: This is command will replace your LOCAL assets Do you want to continue?
cmds:
- rclone copy remote:ico-sync/assets ./assets --progress --update
push-assets:
desc: download assets from the cloud
prompt: This is command will update CLOUD assets Do you want to continue?
cmds:
- rclone copy ./assets remote:ico-sync/assets --progress --update
gen-version-file:
desc: ...
cmds:
- python ./scripts/generate_version.py