tpv-gha-nunja | fs-7.1.11 @ Firestorm_Release_7.1.11 #823
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: CompileWindows | |
on: | |
workflow_dispatch: | |
inputs: | |
fstuple: | |
type: string | |
required: true | |
run-name: ${{ fromJSON(inputs.fstuple).title }} ${{ 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} | |
jobs: | |
windows-build: | |
runs-on: windows-2022 | |
steps: | |
- uses: humbletim/firestorm-gha/gha-node20-run@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: _gha-inline | |
run: | | |
source ${gha_fsvr_dir:-/d/a/_actions/humbletim/firestorm-gha/tpv-gha-nunja}/_gha-inline.sh | |
$gha_fsvr_dir/gha-generate-shell-env.bash | tee -a SHELL.env | |
echo BASH_ENV=$(cygpath -was SHELL.env) | sed 's@\\@\\\\@g' | tee -a $GITHUB_ENV | |
source $ghash/gha.ht-ln.bash | |
ht-ln $gha_fsvr_dir/gha-node20-run ./fsvr-action | |
mkdir -pv env.d bin bin/pystuff cache repo build | |
( | |
echo cache_id=${cache_id:-$(echo "$base-$repo" | sed 's@[^-a-zA-Z0-9_.]@-@g')} | |
echo fsvr_dir=${fsvr_dir:-$PWD/fsvr} | |
echo 'function fsvr_step() {( set -Euo pipefail; $fsvr_dir/util/build.sh "$@" ; )} ; declare -xf fsvr_step' | |
) | tee -a env.d/local.env | |
- name: ~Clone | |
run: | | |
source $ghash/gha.quiet-clone.bash | |
quiet-clone github.com ${GITHUB_REPOSITORY} ${GITHUB_REF_NAME} ${fsvr_dir} | |
- name: Generate gha-bootstrap.env | |
run: | | |
source $gha_fsvr_dir/fsvr-gha-bootstrap.bash | |
get_bootstrap_vars | tee env.d/gha-bootstrap.env || exit 127 | |
- name: Populate local bin | |
uses: ./fsvr-action | |
with: | |
run: | | |
wget --version | head -1 | |
source $gha_fsvr_dir/gha-populate-bin.bash | |
gha-populate-bin-windows | |
- name: Expand Source Repositories | |
uses: ./fsvr-action | |
with: | |
run: | | |
source $ghash/gha.cachette.bash | |
source $ghash/gha.quiet-clone.bash | |
echo "[sourcing] $nunja_dir/000.bash" >&2 | |
. $nunja_dir/000.bash $hub $repo "$ref" | |
- 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 | |
echo gha_fsvr_dir=$gha_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'` | |
( | |
$gha_fsvr_dir/util/generate_build_vars.sh ${viewer_channel:-${viewer_name}-VR-GHA} ${viewer_version} build/ | |
echo blueprint_rel=$(echo "$viewer_version" | cut -d "." -f 4) | |
echo upstream_rel=$(git -C $root_dir rev-list --count HEAD) | |
) | tee env.d/build_vars.env | |
- name: Generate Report | |
uses: ./fsvr-action | |
with: | |
run: | | |
repos="$(for id in `ls -1d repo/* fsvr 2>/dev/null` ; 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 rev-list --count HEAD) $(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 | | |
| --------- | ----------- | | |
| blueprint | $blueprint_rel | | |
| upstream | $upstream_rel | | |
| viewer_id | $viewer_id | | |
| viewer_name | $viewer_name | | |
| viewer_bin | $viewer_bin | | |
| viewer_channel | $viewer_channel | | |
| base | $base | | |
| hub | $hub | | |
| repo | $repo | | |
| ref | $ref | | |
| build_id | $build_id | | |
| cache_id | $cache_id | | |
| hostname | `hostname` | | |
$repos | |
| --------- | ----------- | | |
EOF | |
- name: Detect MSVC | |
uses: ./fsvr-action | |
with: | |
run: | | |
set -Euo pipefail | |
source $ghash/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')" || ( | |
$gha_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 $ghash/gha.cachette.bash | |
gha-cache-restore-fast $cache_id-openvr-d "cache/openvr-**" || ( | |
source $fsvr_dir/openvr/improvise.bash | |
provision_openvr "$fsvr_cache_dir" || _die "openvr/improvise failed" | |
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: 077_preserve | |
if: fromJSON(inputs.fstuple).preserve == '3ps' | |
uses: ./fsvr-action | |
with: | |
run: | | |
set -Euo pipefail | |
source $ghash/gha.upload-artifact.bash | |
source $gha_fsvr_dir/util/reconstitute-dependencies.bash | |
manifest=$build_dir/packages-info.json | |
mkdir -pv $fsvr_cache_dir | |
cp -av $manifest $fsvr_cache_dir/ | |
cp -av $nunja_dir/viewer_version.txt $fsvr_cache_dir/ | |
download_packages $manifest $fsvr_cache_dir || exit 60 | |
verify_downloads $manifest $fsvr_cache_dir || exit 70 | |
gha-upload-artifact-fast \ | |
${base/-avx2}-3p-x86_64-pc-windows-msvc $fsvr_cache_dir || exit 178 | |
- name: 080_untar_packages | |
uses: ./fsvr-action | |
with: | |
run: | | |
set -Euo pipefail | |
source $ghash/gha.cachette.bash | |
gha-cache-restore-fast $cache_id-build-packages-c build/packages || ( | |
source $gha_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: 0a-1_ninja_fauxbuild | |
if: fromJSON(inputs.fstuple).fauxbuild != '' | |
run: | | |
fsvr_step 0a-1_ninja_fauxbuild | |
- name: 089_ninja_build accomodate mis-manifested llwebrtc | |
if: fromJSON(inputs.fstuple).fauxbuild == '' | |
run: | | |
fsvr_step 090 || true # needed here for build.ninja to become instrumented | |
fsvr_step 0a0 llwebrtc # llwebrtc.dll has to be compiled first (then actual preflight below can succeed) | |
- name: 090_ninja_preflight | |
run: fsvr_step 090 | |
- name: ~004 Setup tmate session | |
if: fromJSON(inputs.fstuple).pause == '004' || fromJSON(inputs.fstuple).pause == 'always' | |
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_bin}-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: 0b4 Zip | |
run: fsvr_step 0b4 | |
- name: 0b5 upload zip | |
uses: ./fsvr-action | |
with: | |
run: fsvr_step 0b5 | |
# - 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') || fromJSON(inputs.fstuple).pause == 'always' | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
limit-access-to-actor: true |