From 3e96187edf3fa185b8a18bbd0bfdb723ec05d6f2 Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 6 Feb 2023 00:23:31 +0000 Subject: [PATCH] Improve GHA builds - make sure we use the latest bundles provided - rearrange things a little. - make some initial steps towards trying to make things fail when config/build fails. Improve OS/SL config switch always use latest package version (by timestamp) try another method that deals with not found (looking at you linux havok) oops I hate shell bl@*&y scripts fix pattern revert the autobuild version wth this makes no sense fs-variables must be imported after the code --- .github/workflows/build_viewer.yml | 117 ++++++++++++----------------- requirements.txt | 3 +- scripts/configure_firestorm.sh | 8 +- 3 files changed, 57 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build_viewer.yml b/.github/workflows/build_viewer.yml index 3b45984df8..14061d1e0d 100644 --- a/.github/workflows/build_viewer.yml +++ b/.github/workflows/build_viewer.yml @@ -27,21 +27,17 @@ jobs: python-version: '3.11' cache: 'pip' - run: pip3 install -r requirements.txt + - name: Check python version run: python -V - - name: Checkout build var - uses: actions/checkout@v3 - with: - repository: FirestormViewer/fs-build-variables - path: build-variables + - name: Setup rclone and download the folder uses: beqjanus/setup-rclone@main with: rclone_config: ${{ secrets.RCLONE_CONFIG }} - - name: Set OS flag - if: matrix.grid == 'os' - run: echo "FS_GRID=-DOPENSIM:BOOL=ON" >> $GITHUB_ENV + - name: Set OS/SL flags + run: echo "FS_GRID=-DOPENSIM:BOOL=$([ "${{ matrix.grid }}" == "os" ] && echo "ON" || echo "OFF") -DHAVOK_TPV:BOOL=$([ "${{ matrix.grid }}" == "sl" ] && echo "ON" || echo "OFF")" >> $GITHUB_ENV shell: bash - name: find channel from Branch name @@ -57,46 +53,38 @@ jobs: echo "FS_RELEASE_CHAN=\"${FS_RELEASE_CHAN}\"" >> $GITHUB_ENV echo "Building for channel ${FS_RELEASE_CHAN}" shell: bash - - # - name: Set channel name - # if: matrix.addrsize == '64' - # run: echo "FS_RELEASE_CHAN=Releasex64" >> $GITHUB_ENV - # shell: bash - - # - name: Set channel name for 32 bit - # if: matrix.addrsize == '32' - # shell: bash - - - name: Set SL flag - if: matrix.grid == 'sl' - run: echo "FS_GRID=-DOPENSIM:BOOL=OFF -DHAVOK_TPV:BOOL=ON" >> $GITHUB_ENV - shell: bash - name: Get the code uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Checkout build var + - name: Checkout build vars (after the main code) uses: actions/checkout@v3 with: repository: FirestormViewer/fs-build-variables path: build-variables - - name: rclone the private 3p packages on Windows - if: runner.os == 'Windows' - run: 'rclone copy fs_bundles: --include "*windows*bz2" .' - - name: rclone the private 3p packages on MacOS - if: runner.os == 'MacOS' - run: 'rclone copy fs_bundles: --include "*darwin*bz2" .' - - name: rclone the private 3p packages on Linux - if: runner.os == 'Linux' - run: 'rclone copy fs_bundles: --include "*linux*bz2" .' + - name: Define platform variable + run: | + declare -A os_map + os_map=( ["Windows"]="windows" ["Linux"]="linux" ["macOS"]="darwin" ) + platform="${os_map[${{ runner.os}}]}" + if [ ${{ matrix.addrsize }} -ne 32 ]; + then + platform+=${{ matrix.addrsize }} + fi + echo "platform=${platform}" >> $GITHUB_ENV + shell: bash + + - name: rclone the private 3p packages for this platform + run: 'rclone copy fs_bundles: --include "*${{ env.platform }}*bz2" .' - name: set VSVER for Windows builds if: runner.os == 'Windows' run: echo "AUTOBUILD_VSVER=170" >> $GITHUB_ENV shell: bash + - name: Install certificate if: runner.os == 'macOS' env: @@ -115,48 +103,41 @@ jobs: security import ${build_secrets_checkout}/code-signing-osx/fs-cert.p12 -P "$FS_CERT_PASS" -A -t cert -f pkcs12 -k ~/Library/Keychains/viewer.keychain security set-key-partition-list -S apple-tool:,apple:, -s -k "$FS_KEYCHAIN_PASS" -t private ~/Library/Keychains/viewer.keychain security list-keychain -d user -s ~/Library/Keychains/viewer.keychain + - name: Install required Ubuntu packages if: runner.os == 'Linux' - run: sudo apt-get install python3-setuptools mesa-common-dev libgl1-mesa-dev libxinerama-dev libxrandr-dev libpulse-dev libglu1-mesa-dev - - name: install autobuild - run: pip3 install git+https://github.com/Nicky-D/autobuild@main_nd - - - name: install autobuild - run: pip3 install llbase - - - name: edit installables (64 bit) - if: runner.os == 'Windows' && matrix.addrsize == 64 run: | - autobuild installables edit llphysicsextensions_tpv platform=windows${{matrix.addrsize}} url='file:///\${{ github.workspace }}\llphysicsextensions_tpv-1.0.571939-windows${{matrix.addrsize}}-571939.tar.bz2' - autobuild installables edit fmodstudio platform=windows${{matrix.addrsize}} url='file:///\${{ github.workspace }}\fmodstudio-2.02.09-windows${{matrix.addrsize}}-222890941.tar.bz2' - shell: bash - - - name: edit installables (32 bit) - if: runner.os == 'Windows' && matrix.addrsize == 32 - run: | - autobuild installables edit llphysicsextensions_tpv platform=windows url='file:///\${{ github.workspace }}\llphysicsextensions_tpv-1.0.571939-windows-571939.tar.bz2' - autobuild installables edit fmodstudio platform=windows url='file:///\${{ github.workspace }}\fmodstudio-2.02.09-windows-222890940.tar.bz2' - shell: bash - - - name: edit installables (32/64 agnostic) - if: runner.os == 'Windows' - run: | - autobuild installables edit kdu platform=windows url='file:///\${{ github.workspace }}\kdu-8.2-windows-212351246.tar.bz2' - shell: bash - - - name: edit installables - if: runner.os == 'macOS' - run: | - autobuild installables edit llphysicsextensions_tpv platform=darwin${{matrix.addrsize}} url='file:////${{ github.workspace }}/llphysicsextensions_tpv-1.0.571939-darwin${{matrix.addrsize}}-571939.tar.bz2' - autobuild installables edit kdu platform=darwin url='file:////${{ github.workspace }}/kdu-8.2-darwin-212431232.tar.bz2' - autobuild installables --debug edit fmodstudio platform=darwin${{matrix.addrsize}} url='file:////${{ github.workspace }}/fmodstudio-2.02.09-darwin${{matrix.addrsize}}-5.tar.bz2' - shell: bash + dependencies=("python3-setuptools" "mesa-common-dev" "libgl1-mesa-dev" "libxinerama-dev" "libxrandr-dev" "libpulse-dev" "libglu1-mesa-dev" "libfreetype6-dev" "libfontconfig1") + sudo apt-get update + sudo apt-get install -y "${dependencies[@]}" - name: edit installables - if: runner.os == 'Linux' run: | - autobuild installables edit kdu platform=linux${{matrix.addrsize}} url='file:////${{ github.workspace }}/kdu-8.2-linux${{matrix.addrsize}}_bionic-220911445.tar.bz2' - autobuild installables edit fmodstudio platform=linux${{matrix.addrsize}} url='file:////${{ github.workspace }}/fmodstudio-2.02.09-linux${{matrix.addrsize}}-222891103.tar.bz2' + function find_most_recent_bundle() { + local pattern="$1*${{ env.platform }}*" + local most_recent_file=$(find "${{ github.workspace }}" -name "$pattern" -printf '%T@ %f\n' 2>/dev/null | sort -n | tail -1 | awk '{print $2}') + if [ -z "$most_recent_file" ]; then + echo "" + else + echo "$most_recent_file" + fi + } + if [[ "${{ runner.os }}" == "Windows" ]]; then + path_sep="\\" + else + path_sep="/" + fi + packages=("fmodstudio" "llphysicsextensions_tpv" "kdu") + for package in "${packages[@]}"; do + package_file=$(find_most_recent_bundle $package) + full_package_path="${{ github.workspace }}${path_sep}${package_file}" + if [ -n "$package_file" ]; then + echo "Installing ${package_file}" + autobuild installables edit ${package} platform=${{ env.platform }} url="file:///${full_package_path}" + else + echo "No bundle found for ${package} on ${{ env.platform }}" + fi + done shell: bash - name: Configure diff --git a/requirements.txt b/requirements.txt index 25bcb223a5..9272ca6a2c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ llbase==1.2.11 -git+https://github.com/Nicky-D/autobuild@main_nd#egg=autobuild \ No newline at end of file +git+https://github.com/FirestormViewer/autobuild-3.0#egg=autobuild +# git+https://github.com/Nicky-D/autobuild@main_nd#egg=autobuild \ No newline at end of file diff --git a/scripts/configure_firestorm.sh b/scripts/configure_firestorm.sh index a65f0f05c6..88196d906e 100755 --- a/scripts/configure_firestorm.sh +++ b/scripts/configure_firestorm.sh @@ -595,7 +595,7 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then ../indra/tools/vstool/VSTool.exe --solution Firestorm.sln --startup firestorm-bin --workingdir firestorm-bin "..\\..\\indra\\newview" --config $BTYPE fi fi - +status = 0 if [ $WANTS_BUILD -eq $TRUE ] ; then echo "Building $TARGET_PLATFORM..." if [ $TARGET_PLATFORM == "darwin" ] ; then @@ -626,6 +626,10 @@ if [ $WANTS_BUILD -eq $TRUE ] ; then -verbosity:normal -toolsversion:15.0 -p:"VCBuildAdditionalOptions= /incremental" fi fi + if [ $? -ne 0 ]; then + status=1 + fi fi +echo "Finished status=$status" +exit $status -echo "Finished"