-
Notifications
You must be signed in to change notification settings - Fork 13
258 lines (220 loc) · 8.22 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
name: CompileWindows
on:
workflow_dispatch:
inputs:
fstuple:
type: string
required: true
run-name: ${{ github.ref_name }} | ${{ fromJSON(inputs.fstuple).base }} @ ${{ fromJSON(inputs.fstuple).ref }}
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:
generate-bin:
runs-on: windows-2022
steps:
- uses: humbletim/firestorm-gha/actions-node-script@tpv-gha-nunja
if: false
- uses: actions/cache@v4
if: false
- name: SHELL.env
run: source /d/a/_actions/humbletim/firestorm-gha/tpv-gha-nunja/_gha-inline.sh
- name: postflight tests
run: |
set -Euo pipefail
echo cache_id=$cache_id
echo "PATH='$PATH'"
jq --version
python3 --version
- name: Populate local bin
uses: ./fsvr-action
with:
run: . $fsvr_dir/gha-populate-bin.sh && gha-populate-bin-windows
- name: ~000 Setup tmate session
uses: mxschmitt/action-tmate@v3
if: failure() && fromJSON(inputs.fstuple).pause != 'never'
with:
limit-access-to-actor: true
windows-build:
if: true
needs: generate-bin
runs-on: windows-2022
steps:
- uses: humbletim/firestorm-gha/actions-node-script@tpv-gha-nunja
if: false
- uses: actions/upload-artifact@v4
if: false
- uses: actions/cache@v4
if: false
- name: Output Inputs
run: |
echo '${{ github.event.inputs.fstuple }}'
echo '${{ fromJSON(github.event.inputs.fstuple) }}'
- name: ~Clone
run: |
source /d/a/_actions/${GITHUB_REPOSITORY}/${GITHUB_REF_NAME}/_gha-inline.sh
echo "https://github.com/${GITHUB_REPOSITORY}/tree/$(git -C $fsvr_dir rev-parse --short HEAD)" > $fsvr_dir/.gha_source
- name: Generate gha-bootstrap.env
run: |
source $fsvr_dir/gha-bootstrap.sh
get_bootstrap_vars | tee env.d/gha-bootstrap.env || exit 127
- name: Populate local bin
uses: ./fsvr-action
with:
run: . $fsvr_dir/gha-populate-bin.sh && gha-populate-bin-windows
- name: Expand Source Repositories
uses: ./fsvr-action
with:
run: |
source $fsvr_dir/util/gha.cachette.bash
source $fsvr_dir/util/gha.quiet-clone.bash
echo "[sourcing] $nunja_dir/000.bash" >&2
. $nunja_dir/000.bash $hub $repo "$ref"
# - 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
test $(echo 'test-$a' | eval "a=b envsubst") == test-b || exit 124
- name: Generate Build Vars
run: |
set -euo pipefail
echo fsvr_dir=$fsvr_dir
export root_dir=${root_dir:-repo/viewer}
# some legacy viewer packaging logic reaches from build* to ../indra
test -d $root_dir/indra && ht-ln $root_dir/indra indra
viewer_version=`cat $nunja_dir/viewer_version.txt | tr -d '\r'`
$fsvr_dir/util/generate_build_vars.sh ${viewer_channel:-${viewer_name}-VR-GHA} ${viewer_version} build/ \
| tee env.d/build_vars.env
- name: Generate Report
uses: ./fsvr-action
with:
run: |
repos="$(for id in `ls -1d repo/* fsvr` ; do
url="$(test -s $id/.gha_source && echo "[$id]($(cat $id/.gha_source))" || git -C $id rev-parse --short HEAD)"
echo "| ./$id | $(git -C $id describe --all --always) *$(git -C $id rev-parse --short HEAD)* $url |"
done)"
tools="$(for id in jq ninja parallel bash ; do
echo "| $id | $($id --version | head -n 1 || true) |"
done)"
test -v GITHUB_STEP_SUMMARY || GITHUB_STEP_SUMMARY=/dev/stdout
cat <<EOF | tee $GITHUB_STEP_SUMMARY
| name | value |
| --------- | ----------- |
| viewer_id | $viewer_id |
| viewer_name | $viewer_name |
| viewer_exe | $viewer_exe |
| viewer_channel | $viewer_channel |
| base | $base |
| hub | $hub |
| repo | $repo |
| ref | $ref |
| build_id | $build_id |
| cache_id | $cache_id |
| hostname | `hostname` |
$repos
$tools
| --------- | ----------- |
EOF
- name: Detect MSVC
uses: ./fsvr-action
with:
run: |
set -Euo pipefail
source $fsvr_dir/util/gha.cachette.bash
declare -a msvcs=(build/msvc.env build/msvc.nunja.env build/msvc_path.env)
gha-cache-restore-fast "$cache_id-msvc-a" "$(echo "${msvcs[@]}" | tr ' ' '\n')" || (
$fsvr_dir/util/generate_msvc_env.sh
ls -l ${msvcs[@]}
gha-cache-save-fast "$cache_id-msvc-a" "$(echo "${msvcs[@]}" | tr ' ' '\n')" || exit 179
)
- name: 010_ensure_build_directories && 020_perform_replacements
run: fsvr_step 010 && fsvr_step 020
- name: 038_provision_openvr
uses: ./fsvr-action
with:
run: |
set -Euo pipefail
source $fsvr_dir/util/gha.cachette.bash
gha-cache-restore-fast $cache_id-openvr-d cache/openvr-** || (
fsvr_step 038_provision_openvr || exit 38
gha-cache-save-fast $cache_id-openvr-d cache/openvr-** || exit 196
)
- name: 039_provision_p373r
run: fsvr_step 039
- name: 040_generate_package_infos && 050_generate_packages_info_text
run: fsvr_step 040 && fsvr_step 050
- name: 080_untar_packages
uses: ./fsvr-action
with:
run: |
set -Euo pipefail
source $fsvr_dir/util/gha.cachette.bash
gha-cache-restore-fast $cache_id-build-packages-c build/packages || (
source $fsvr_dir/util/reconstitute-dependencies.bash
manifest=$build_dir/packages-info.json
download_packages $manifest $fsvr_cache_dir || exit 60
verify_downloads $manifest $fsvr_cache_dir || exit 70
untar_packages $manifest $fsvr_cache_dir $packages_dir || exit 80
gha-cache-save-fast $cache_id-build-packages-c build/packages || exit 220
)
- 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 application-bin.exe
run: fsvr_step 0a0 ${viewer_exe}-bin.exe
- name: 0a0_ninja_build llpackage
run: fsvr_step 0a0 llpackage
- name: 0a1 postbuild
run: fsvr_step 0a1
- name: 0b0 installer
run: fsvr_step 0b0
- name: 0b1 upload installer
uses: ./fsvr-action
with:
run: fsvr_step 0b1
- name: 0b2 7z
run: fsvr_step 0b2
- name: 0b3 upload 7z
uses: ./fsvr-action
with:
run: fsvr_step 0b3
# - name: log env on error
# if: failure()
# uses: ./fsvr-action
# with:
# run: |
# ./fsvr/util/_utils.sh upload_artifact debug "$(cat <<EOF
# SHELL.env
# env.d/gha-bootstrap.env
# env.d/build_vars.env
# build/msvc.env
# build/msvc_path.env
# build/msvc.nunja.env
# EOF
# )"
- name: ~Setup tmate session
if: failure() && fromJSON(inputs.fstuple).pause != 'never'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true