From c2730b4fffe580bc99f29f1ba37aa45427f99b93 Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:44:59 +0100 Subject: https://github.com/secondlife/viewer/issues/1286 - determine viewer_channel from branch name in builds --- .github/workflows/build.yaml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1dd2c1d5df..3abb43b2b2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,7 +5,7 @@ on: pull_request: push: branches: ["main", "release/*", "project/*"] - tags: ["Second_Life_*"] + tags: ["Second_Life*"] jobs: build: @@ -170,13 +170,18 @@ jobs: # seen before, so numerous tests don't know about it. [[ "$arch" == "MINGW6" ]] && arch=CYGWIN export AUTOBUILD="$(which autobuild)" - # Build with a tag like "Second_Life_Project_Shiny#abcdef0" to get a - # viewer channel "Second Life Project Shiny" (ignoring "#hash", - # needed to disambiguate tags). - if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME:0:12}" == "Second_Life_" ]] - then viewer_channel="${GITHUB_REF_NAME%#*}" - export viewer_channel="${viewer_channel//_/ }" - else export viewer_channel="Second Life Test" + + # determine the viewer channel from the branch name + IFS='/' read -ra ba <<< "$AUTOBUILD_VCS_BRANCH" + prefix=${ba[0]} + if [ "$prefix" == "project" ]; then + proj_name=$(echo ${ba[1]} | sed -e 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2));}1') + export viewer_channel="Second Life Project $proj_name" + elif [ "$prefix" == "release" ] || [ "$prefix" == "main" ]; + then + export viewer_channel="Second Life Release" + else + export viewer_channel="Second Life Test" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" @@ -326,7 +331,8 @@ jobs: release: needs: [sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest - if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_') + # Build with a tag like "Second_Life#abcdef0" to generate a release page (used for builds we are planning to deploy). + if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') steps: - uses: actions/download-artifact@v3 with: -- cgit v1.2.3 From f39987f3828fca4520db335582daadd9bc484255 Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:47:46 +0100 Subject: https://github.com/secondlife/viewer/issues/1286 - branch var from github.repository --- .github/workflows/build.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3abb43b2b2..f948669f32 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -172,10 +172,12 @@ jobs: export AUTOBUILD="$(which autobuild)" # determine the viewer channel from the branch name - IFS='/' read -ra ba <<< "$AUTOBUILD_VCS_BRANCH" - prefix=${ba[0]} + branch=${{ github.repository }} + IFS='/' read -ra ba <<< $branch + username=${ba[0]} + prefix=${ba[1]} if [ "$prefix" == "project" ]; then - proj_name=$(echo ${ba[1]} | sed -e 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2));}1') + proj_name=$(echo ${ba[2]} | sed -e 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2));}1') export viewer_channel="Second Life Project $proj_name" elif [ "$prefix" == "release" ] || [ "$prefix" == "main" ]; then @@ -184,7 +186,7 @@ jobs: export viewer_channel="Second Life Test" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" - + exit 1 # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module # will resolve the correct interpreter location. -- cgit v1.2.3 From a65de9354196984fc78b82a7505723ab7f916f97 Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:51:19 +0100 Subject: https://github.com/secondlife/viewer/issues/1286 - branch var from github.repository --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f948669f32..20078f2e00 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -173,6 +173,7 @@ jobs: # determine the viewer channel from the branch name branch=${{ github.repository }} + echo "branch=$branch" >> "$GITHUB_OUTPUT" IFS='/' read -ra ba <<< $branch username=${ba[0]} prefix=${ba[1]} @@ -186,7 +187,6 @@ jobs: export viewer_channel="Second Life Test" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" - exit 1 # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module # will resolve the correct interpreter location. -- cgit v1.2.3 From 6ca4dfdb56d0107368a09af2b089c24d32e7108d Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:16:26 -0400 Subject: Update build.yaml --- .github/workflows/build.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 20078f2e00..ee02ed58e8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -59,8 +59,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Setup python uses: actions/setup-python@v4 with: -- cgit v1.2.3 From 65495ba7655cbe17d282536a8c2a21d2ac29de23 Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Wed, 1 May 2024 16:42:09 +0100 Subject: set viewer channel from branch --- .github/workflows/build.yaml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 813b6a96ef..42d6562db6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -59,11 +59,6 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - name: Setup python uses: actions/setup-python@v5 @@ -183,13 +178,12 @@ jobs: export AUTOBUILD="$(which autobuild)" # determine the viewer channel from the branch name - branch=${{ github.repository }} + branch=$AUTOBUILD_VCS_BRANCH echo "branch=$branch" >> "$GITHUB_OUTPUT" IFS='/' read -ra ba <<< $branch - username=${ba[0]} - prefix=${ba[1]} + prefix=${ba[0]} if [ "$prefix" == "project" ]; then - proj_name=$(echo ${ba[2]} | sed -e 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2));}1') + proj_name=$(echo ${ba[1]} | sed -e 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2));}1') export viewer_channel="Second Life Project $proj_name" elif [ "$prefix" == "release" ] || [ "$prefix" == "main" ]; then -- cgit v1.2.3 From 7f23f160d7520034afd8c3be8a184eac1716227a Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Wed, 1 May 2024 17:51:44 +0100 Subject: trim trailing whitespace --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 42d6562db6..d318d2eaf3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,8 +58,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Setup python uses: actions/setup-python@v5 with: -- cgit v1.2.3 From eb0f963b46c68ad8faee133996599ba97b54d034 Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Thu, 2 May 2024 09:48:26 -0400 Subject: Update build.yaml --- .github/workflows/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d318d2eaf3..e4952d9493 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -179,13 +179,13 @@ jobs: # determine the viewer channel from the branch name branch=$AUTOBUILD_VCS_BRANCH - echo "branch=$branch" >> "$GITHUB_OUTPUT" IFS='/' read -ra ba <<< $branch prefix=${ba[0]} if [ "$prefix" == "project" ]; then - proj_name=$(echo ${ba[1]} | sed -e 's/_/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2));}1') - export viewer_channel="Second Life Project $proj_name" - elif [ "$prefix" == "release" ] || [ "$prefix" == "main" ]; + IFS='_' read -ra prj << "${ba[1]}" + # uppercase first letter of each word + export viewer_channel="Second Life Project ${prj[*]^}" + elif [ "$prefix" == "release" || "$prefix" == "main" ]; then export viewer_channel="Second Life Release" else -- cgit v1.2.3 From 6eeef10cda794607c8fbed6fe89179c09a42224b Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Thu, 2 May 2024 10:08:46 -0400 Subject: Update build.yaml --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e4952d9493..4785273b78 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -182,10 +182,10 @@ jobs: IFS='/' read -ra ba <<< $branch prefix=${ba[0]} if [ "$prefix" == "project" ]; then - IFS='_' read -ra prj << "${ba[1]}" + IFS='_' read -ra prj <<< "${ba[1]}" # uppercase first letter of each word export viewer_channel="Second Life Project ${prj[*]^}" - elif [ "$prefix" == "release" || "$prefix" == "main" ]; + elif [[ "$prefix" == "release" || "$prefix" == "main" ]]; then export viewer_channel="Second Life Release" else -- cgit v1.2.3 From afd726979aa544571addc94226155d6ab4e6c5ed Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 11 May 2024 09:58:22 -0400 Subject: Turn on GH Windows ReleaseOS build --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4785273b78..1a2b914e9a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,6 +16,9 @@ jobs: include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" + include: + - runner: windows-large + configuration: ReleaseOS runs-on: ${{ matrix.runner }} outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} -- cgit v1.2.3 From 4f70946048def860e54117ce03f4e9e57c415491 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 11 May 2024 10:14:49 -0400 Subject: Fix syntax error in build.yaml to enable Windows ReleaseOS --- .github/workflows/build.yaml | 1 - 1 file changed, 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1a2b914e9a..c500b3592d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,6 @@ jobs: include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" - include: - runner: windows-large configuration: ReleaseOS runs-on: ${{ matrix.runner }} -- cgit v1.2.3 From a4d2574df2af19f5baa57bf27b5c5f888b765ede Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 13 May 2024 13:46:42 -0400 Subject: Run ReleaseOS builds, but only when a release page is requested. --- .github/workflows/build.yaml | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c500b3592d..3bf7964ba2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,17 +7,24 @@ on: branches: ["main", "release/*", "project/*"] tags: ["Second_Life*"] +env: + # Build with a tag like "Second_Life#abcdef0" to generate a release page + # (used for builds we are planning to deploy). + RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' }} + jobs: build: strategy: matrix: runner: [windows-large, macos-12-xl] configuration: [Release] + Linden: [true] include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" - runner: windows-large configuration: ReleaseOS + Linden: false runs-on: ${{ matrix.runner }} outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} @@ -39,7 +46,10 @@ jobs: AUTOBUILD_VSVER: "170" DEVELOPER_DIR: ${{ matrix.developer_dir }} # Ensure that Linden viewer builds engage Bugsplat. - BUGSPLAT_DB: ${{ matrix.configuration != 'ReleaseOS' && 'SecondLife_Viewer_2018' || '' }} + BUGSPLAT_DB: ${{ matrix.Linden && 'SecondLife_Viewer_2018' || '' }} + # Run BUILD steps for Release configuration. + # Run BUILD steps for ReleaseOS configuration only for release runs. + BUILD: ${{ (matrix.Linden || env.RELEASE_RUN) && 'Y' || '' }} build_coverity: false build_log_dir: ${{ github.workspace }}/.logs build_viewer: true @@ -58,16 +68,19 @@ jobs: variants: ${{ matrix.configuration }} steps: - name: Checkout code + if: env.BUILD uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup python + if: env.BUILD uses: actions/setup-python@v5 with: python-version: "3.11" - name: Checkout build variables + if: env.BUILD uses: actions/checkout@v4 with: repository: secondlife/build-variables @@ -75,17 +88,20 @@ jobs: path: .build-variables - name: Checkout master-message-template + if: env.BUILD uses: actions/checkout@v4 with: repository: secondlife/master-message-template path: .master-message-template - name: Install autobuild and python dependencies + if: env.BUILD run: pip3 install autobuild llsd - name: Cache autobuild packages - uses: actions/cache@v4 id: cache-installables + if: env.BUILD + uses: actions/cache@v4 with: path: .autobuild-installables key: ${{ runner.os }}-64-${{ matrix.configuration }}-${{ hashFiles('autobuild.xml') }} @@ -94,17 +110,19 @@ jobs: ${{ runner.os }}-64- - name: Install windows dependencies - if: runner.os == 'Windows' + if: env.BUILD && runner.os == 'Windows' run: choco install nsis-unicode - name: Determine source branch id: which-branch + if: env.BUILD uses: secondlife/viewer-build-util/which-branch@v2 with: token: ${{ github.token }} - name: Build id: build + if: env.BUILD shell: bash env: AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }} @@ -227,7 +245,7 @@ jobs: echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT - name: Upload executable - if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.viewer_app + if: matrix.Linden && steps.build.outputs.viewer_app uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-app" @@ -237,7 +255,7 @@ jobs: # The other upload of nontrivial size is the symbol file. Use a distinct # artifact for that too. - name: Upload symbol file - if: matrix.configuration != 'ReleaseOS' + if: matrix.Linden uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-symbols" @@ -245,7 +263,7 @@ jobs: ${{ steps.build.outputs.symbolfile }} - name: Upload metadata - if: matrix.configuration != 'ReleaseOS' + if: matrix.Linden uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-metadata" @@ -256,7 +274,7 @@ jobs: - name: Upload physics package uses: actions/upload-artifact@v4 # should only be set for viewer-private - if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.physicstpv + if: matrix.Linden && steps.build.outputs.physicstpv with: name: "${{ steps.build.outputs.artifact }}-physics" # emitted by build.sh, zero or one lines @@ -362,8 +380,7 @@ jobs: release: needs: [build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest - # Build with a tag like "Second_Life#abcdef0" to generate a release page (used for builds we are planning to deploy). - if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') + if: env.RELEASE_RUN steps: - uses: actions/download-artifact@v4 with: -- cgit v1.2.3 From 9d30040dfe161e750a897065c16450478e740aa9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 May 2024 15:57:50 -0400 Subject: Try to work around workflow YAML env setting limitation. --- .github/workflows/build.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3bf7964ba2..afac61cb1b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,22 @@ env: RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' }} jobs: + # The whole point of the setvar job is that we want to reference global + # env.RELEASE_RUN in build.env, but a job.env can't directly reference the + # global env context. + setvar: + runs-on: ubuntu-latest + outputs: + release_run: ${{ steps.setvar.outputs.release_run }} + steps: + - name: Set Variable + id: setvar + shell: bash + run: | + echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT" + build: + needs: setvar strategy: matrix: runner: [windows-large, macos-12-xl] @@ -49,7 +64,7 @@ jobs: BUGSPLAT_DB: ${{ matrix.Linden && 'SecondLife_Viewer_2018' || '' }} # Run BUILD steps for Release configuration. # Run BUILD steps for ReleaseOS configuration only for release runs. - BUILD: ${{ (matrix.Linden || env.RELEASE_RUN) && 'Y' || '' }} + BUILD: ${{ (matrix.Linden || needs.setvar.outputs.release_run) && 'Y' || '' }} build_coverity: false build_log_dir: ${{ github.workspace }}/.logs build_viewer: true -- cgit v1.2.3 From 18c1458409fbb4ab3a734bd80673a7726fee107f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 May 2024 16:01:26 -0400 Subject: Can't reference global env in job.if either. --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index afac61cb1b..07499f768c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -393,9 +393,9 @@ jobs: version: ${{ needs.build.outputs.viewer_version }} release: - needs: [build, sign-and-package-windows, sign-and-package-mac] + needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest - if: env.RELEASE_RUN + if: needs.setvar.outputs.release_run steps: - uses: actions/download-artifact@v4 with: -- cgit v1.2.3 From f822193974af363fa4bb0208dc02848be6c983a2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 May 2024 16:08:54 -0400 Subject: Make env.RELEASE_RUN the empty string if false not the string "false", which is true. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 07499f768c..47f612f028 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ on: env: # Build with a tag like "Second_Life#abcdef0" to generate a release page # (used for builds we are planning to deploy). - RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' }} + RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' || '' }} jobs: # The whole point of the setvar job is that we want to reference global -- cgit v1.2.3 From 1f0b80f709dd3b263e88ca6e3db027a1406ec240 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 May 2024 17:15:25 -0400 Subject: Streamline the new workflow `RELEASE_RUN` logic a little. Since downstream jobs reference the output of the new `setvar` job, instead of directly referencing global `env.RELEASE_RUN`, no need to set `RELEASE_RUN` in the global environment. --- .github/workflows/build.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 47f612f028..94bd13f4af 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,19 +7,22 @@ on: branches: ["main", "release/*", "project/*"] tags: ["Second_Life*"] -env: - # Build with a tag like "Second_Life#abcdef0" to generate a release page - # (used for builds we are planning to deploy). - RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' || '' }} - jobs: - # The whole point of the setvar job is that we want to reference global - # env.RELEASE_RUN in build.env, but a job.env can't directly reference the - # global env context. + # The whole point of the setvar job is that we want to set a variable once + # that will be consumed by multiple subsequent jobs. We tried setting it in + # the global env, but a job.env can't directly reference the global env + # context. setvar: runs-on: ubuntu-latest outputs: release_run: ${{ steps.setvar.outputs.release_run }} + env: + # Build with a tag like "Second_Life#abcdef0" to generate a release page + # (used for builds we are planning to deploy). + # When you want to use a string variable as a workflow YAML boolean, it's + # important to ensure it's the empty string when false. If you omit || '', + # its value when false is "false", which is interpreted as true. + RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' || '' }} steps: - name: Set Variable id: setvar -- cgit v1.2.3 From 0960ae78923b51df4408bfaaeba5399f85d55efe Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 15 May 2024 14:41:56 -0700 Subject: Experiment with getting manually triggered workflow builds to optionally do a release --- .github/workflows/build.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 94bd13f4af..364a3a97e8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,6 +2,11 @@ name: Build on: workflow_dispatch: + inputs: + release_run: + type: boolean + description: Do a release of this build + default: false pull_request: push: branches: ["main", "release/*", "project/*"] @@ -398,7 +403,7 @@ jobs: release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest - if: needs.setvar.outputs.release_run + if: needs.setvar.outputs.release_run || github.event.inputs.release_run steps: - uses: actions/download-artifact@v4 with: -- cgit v1.2.3 From 7feec9998e61c234b1a9557c2edf8fc2b52a73cc Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 15 May 2024 15:04:16 -0700 Subject: Move all release_run logic into setvar job. --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 364a3a97e8..b60f787a9c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,7 +27,7 @@ jobs: # When you want to use a string variable as a workflow YAML boolean, it's # important to ensure it's the empty string when false. If you omit || '', # its value when false is "false", which is interpreted as true. - RELEASE_RUN: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life') && 'Y' || '' }} + RELEASE_RUN: ${{ (github.event.inputs.release_run || github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')) && 'Y' || '' }} steps: - name: Set Variable id: setvar @@ -403,7 +403,7 @@ jobs: release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest - if: needs.setvar.outputs.release_run || github.event.inputs.release_run + if: needs.setvar.outputs.release_run steps: - uses: actions/download-artifact@v4 with: -- cgit v1.2.3 From 8011d3f457ca86b9610d5e9580d554393dd4a0a6 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 15 May 2024 16:08:04 -0700 Subject: Fix channel detection for mac builds --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4785273b78..b26006f2ff 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -179,7 +179,7 @@ jobs: # determine the viewer channel from the branch name branch=$AUTOBUILD_VCS_BRANCH - IFS='/' read -ra ba <<< $branch + IFS='/' read -ra ba <<< "$branch" prefix=${ba[0]} if [ "$prefix" == "project" ]; then IFS='_' read -ra prj <<< "${ba[1]}" -- cgit v1.2.3