-
Notifications
You must be signed in to change notification settings - Fork 13
356 lines (303 loc) · 12 KB
/
CompileWindows.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
name: CompileWindows
on:
# pull_request:
workflow_dispatch:
inputs:
fstuple:
type: string
default: '{ "base":"6.6.17", "repo":"FirestormViewer/phoenix-firestorm", "branch": "Firestorm_6.6.17" }'
options: |
{ "base":"6.6.17", "repo":"FirestormViewer/phoenix-firestorm", "branch": "Firestorm_6.6.17" }
{ "base":"7.1.2", "repo":"FirestormViewer/phoenix-firestorm-alpha", "branch": "master" }
{ "base":"7.1.2", "repo":"Sgeo/phoenix-firestorm-alpha", "branch": "VR_Sgeo_2024" }
{ "base":"7.1.4", "repo":"FirestormViewer/phoenix-firestorm", "branch": "7.1.4_Mar14_preview" }
run-name: ${{ fromJSON(inputs.fstuple).branch }} @ ${{ fromJSON(inputs.fstuple).base }}
defaults:
run:
shell: c:/PROGRA~1/Git/usr/bin/bash.exe --noprofile --norc -e -o pipefail {0}
# shell: c:\Program Files\Git\usr\bin\bash.exe --noprofile --norc -e -o pipefail {0}
# shell: C:\msys64\usr\bin\bash.exe --noprofile --norc -e -o pipefail {0}
env:
BASH_ENV: ${{ github.workspace }}\SHELL.env
jobs:
windows_build:
runs-on: windows-2022
steps:
# no-ops that pre-populate upload-artifact, restore-only and save-only in /d/a/_actions/actions
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: /invalid/path
if-no-files-found: ignore
- uses: actions/cache/restore@v4
# - uses: actions/cache@v4
with:
lookup-only: true
key: /dev/null
path: /dev/null
- name: Output Inputs
run: |
echo '${{ github.event.inputs.fstuple }}'
echo '${{ fromJSON(github.event.inputs.fstuple) }}'
echo '${{ inputs.fstuple }}' | jq -r 'to_entries[]|[.key,.value]|join("=")' | tee -a $GITHUB_ENV
. $GITHUB_ENV
echo "cache_id=$(echo "$base-$repo" | sed 's@[^-a-zA-Z0-9_.]@-@g')" | tee -a $GITHUB_ENV
echo "build_id=$(echo "${GITHUB_REF}-$base" | sed 's@[^-a-zA-Z0-9_.]@-@g')" | tee -a $GITHUB_ENV
- name: Clone
run: |
mkdir -pv bin bin/pystuff cache repo build
git clone --quiet --filter=tree:0 --single-branch --branch ${GITHUB_REF_NAME} https://github.com/${GITHUB_REPOSITORY} fsvr
- name: Generate SHELL.env
run: |
fsvr_dir=$PWD/fsvr fsvr/gha-generate-shell-env.sh | tee -a SHELL.env
fsvr/util/_utils.sh ht-ln fsvr/actions-node-script ./fsvr-action
- name: 000 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '000'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Generate gha-bootstrap.env
run: |
fsvr_repo=${GITHUB_REPOSITORY}
fsvr_branch=${GITHUB_REF_NAME}
fsvr_base=$base
source fsvr/gha-bootstrap.sh
get_bootstrap_vars | tee gha-bootstrap.env || exit 127
- name: 001 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '001'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Generated bin/
run: |
test -d "$fsvr_dir" || exit 63
. fsvr/bashland/gha.alias-exe.bash
make-stub bin/BASH_FUNC_invoke.exe
fsvr/util/_utils.sh ht-ln bin/BASH_FUNC_invoke.exe bin/ht-ln.exe
ht-ln bin/BASH_FUNC_invoke.exe bin/hostname.exe
ht-ln bin/BASH_FUNC_invoke.exe bin/jq.exe
- name: Populated bin/
uses: ./fsvr-action
with:
run: |
test -d "$fsvr_dir" || exit 63
source fsvr/gha-bootstrap.sh
source $fsvr_dir/util/gha.cachette.bash
function xxtest_bin() {
test -f bin/parallel-home/will-cite || return 196
parallel -- --version | head -1 || return 197
ninja --version | head -1 || return 198
[[ `hostname` =~ windows[-]?2022 ]] || return 199
jq --version | head -1 || return 200
which parallel.exe
which colout
which jq
}
gha-cache-restore $base-bin-b bin || (
set -Euo pipefail
literally_exists bin/ninja.exe || get_ninja || exit `_err $? "failed to provision ninja $?"`
literally_exists bin/pystuff/Python39 || get_colout || exit `_err $? "failed to provision .colout $?"`
literally_exists bin/parallel || get_parallel || exit `_err $? "failed to provision parallel $?"`
literally_exists bin/colout.exe || ht-ln bin/BASH_FUNC_invoke.exe bin/colout.exe
literally_exists bin/parallel.exe || ht-ln bin/BASH_FUNC_invoke.exe bin/parallel.exe
# note: autobuild is not necessary here, but viewer_manifest still depends on python-llsd
python -m pip install --no-warn-script-location --user llsd
xxtest_bin || exit `_err $? "!xxtest_bin"`
gha-cache-save $base-bin-b bin || exit 85
)
- name: 002 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '002'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: SHELL.sh env test
run: |
set -eu
echo base=$base repo=$repo branch=$branch
which tee.exe
which parallel.exe
tee --version | head -1
parallel --version | head -1
hostname --version | head -1
jq --version | head -1
[[ "$((( echo stdout ; echo stderr >&2 ) | tee /dev/stderr) 2>&1)" =~ stderr.*stdout.*stdout ]] || exit 83
- name: Expand Source Repositories
uses: ./fsvr-action
with:
run: |
source $fsvr_dir/gha-bootstrap.sh
source $fsvr_dir/util/gha.cachette.bash
gha-cache-restore $cache_id-repo-a repo || (
set -Euo pipefail
test -d repo/$branch/.git || quiet_clone $repo $branch repo/$branch
test -d repo/p373r/.git || quiet_clone ${GITHUB_REPOSITORY} P373R_6.6.8 repo/p373r
test -d repo/fs-build-variables/.git || \
quiet_clone FirestormViewer/fs-build-variables c57be16efb2b48d9e117c7449fc105c7f9da16d0 repo/fs-build-variables
gha-cache-save $cache_id-repo-a repo || exit 107
)
repos="$(for id in repo/$branch repo/p373r repo/fs-build-variables ; do
echo "| ./$id | $(git -C $id describe --all --always) |"
done)"
tools="$(for id in jq ninja parallel bash ; do
echo "| $id | $($id --version | head -1 || true) |"
done)"
cat <<EOF >> $GITHUB_STEP_SUMMARY
| name | value |
| --------- | ----------- |
| build_id | $build_id |
| cache_id | $cache_id |
| base | $base |
| repo | $repo |
| branch | $branch |
| hostname | `hostname` |
$repos
$tools
EOF
- name: 003 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '003'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: fsvr-action args test
uses: ./fsvr-action
with:
environment: foo=bar
args: An argument string ${{ inputs.fstuple }}
run: |
echo ok 1=$1 2=$2 args="$(echo "$@")"
- name: PATH/ENV preflight tests
run: |
jq --version
test `hostname` == "windows-2022" || exit 2022
test -v nunja_dir || exit 122
test -d "$nunja_dir" || exit 123
echo 'test $a' | env a=b envsubst || exit 124
- name: Generate Build Vars
run: |
set -euo pipefail
echo fsvr_dir=$fsvr_dir
export root_dir=repo/$branch
$fsvr_dir/util/_utils.sh ht-ln $root_dir/indra indra
$fsvr_dir/util/generate_build_vars.sh Firestorm-VR-GHA `cat $fsvr_dir/$base/viewer_version.txt` build/ \
| tee build/build_vars.env #| tee $GITHUB_ENV
- name: Detect MSVC
uses: ./fsvr-action
with:
run: |
set -Euo pipefail
export INPUT_key=$base-cache-msvc-a INPUT_path="$(echo 'build/msvc.env build/msvc_path.env' | tr ' ' '\n')"
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/restore-only/index.js \
| grep -i 'cache restored' && { echo 'yup' ; ls -l build/msvc.env build/msvc.nunja.env ; } || {
echo 'nope'
$fsvr_dir/util/generate_msvc_env.sh
ls -l build/msvc.env build/msvc.nunja.env
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/save-only/index.js
}
- name: 010_ensure_build_directories
run: fsvr_step 010
- name: 020_perform_replacements
run: fsvr_step 020
- name: 038_provision_openvr
uses: ./fsvr-action
with:
run: |
set -Euo pipefail
tarball=$fsvr_cache_dir/openvr-v1.6.10.8eaf723.tar.bz2
export INPUT_key=$base-cache-openvr-d INPUT_path=cache/openvr-**
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/restore-only/index.js \
| grep -i 'cache restored' && { echo 'yup' ; ls -l $fsvr_cache_dir ; } || {
echo 'nope'
fsvr_step 038_provision_openvr || exit 38
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/save-only/index.js
}
- name: 039_provision_p373r
run: fsvr_step 039
- name: 040_generate_package_infos
run: fsvr_step 040
- name: 050_generate_packages_info_text
run: fsvr_step 050
#
# - name: 060_download_packages
# run: fsvr_step 060
#
# - name: 070_verify_downloads
# run: fsvr_step 070
#
- name: 080_untar_packages
uses: ./fsvr-action
with:
run: |
set -Euo pipefail
export INPUT_key=$base-build-packages-c INPUT_path=build/packages
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/restore-only/index.js \
| grep -i 'cache restored' && echo 'yup' || {
echo 'nope'
fsvr_step 060_download_packages || exit 60
fsvr_step 070_verify_downloads || exit 70
fsvr_step 080_untar_packages || exit 80
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/save-only/index.js
}
#
# - name: 070_verify_downloads
# run: fsvr_step 070
# - name: 080_untar_packages
# run: fsvr_step 080
- name: 085_prepare_msys_msvc
run: fsvr_step 085
- name: 090_ninja_preflight
run: fsvr_step 090
- name: 004 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '004'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: 0a0_ninja_build SLPlugin.exe
run: fsvr_step 0a0 SLPlugin.exe
- name: 0a0_ninja_build firestorm-bin.exe
run: fsvr_step 0a0 firestorm-bin.exe
- name: 0a0_ninja_build llpackage
run: fsvr_step 0a0 llpackage
- name: 0b0_bundle
run: fsvr_step 0b0
- name: 0c0_upload_artifacts
uses: ./fsvr-action
with:
run: fsvr_step 0c0
- name: 005 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '005'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: log env on error
if: failure()
uses: ./fsvr-action
with:
run: |
./fsvr/util/_utils.sh upload_artifact debug "$(cat <<EOF
SHELL.env
gha-bootstrap.env
build/build_vars.env
build/msvc.env
build/msvc.path.env
build/msvc.nunja.env
EOF
)"
- name: 006 Setup tmate session
if: fromJSON(inputs.fstuple).pause == '006'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
#
#
# - name: Setup tmate session
# if: failure()
# uses: mxschmitt/action-tmate@v3
# env:
# PATH: /c/msys64/usr/bin:${{ env.PATH}}
# with:
# limit-access-to-actor: true