From 3c0710172e03329004a2962e0313d883b143d3ad Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 16 May 2024 16:05:43 -0400 Subject: Try to fix release_run logic in build.yaml. --- .github/workflows/build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b60f787a9c..b301e88f48 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.event.inputs.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,11 @@ jobs: release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest - if: needs.setvar.outputs.release_run + # action-gh-release requires a tag (presumably for automatic generation of + # release notes). Possible TODO: if we arrive here but do not have a + # suitable tag for github.sha, create one? If we do that, of course remove + # this == 'tag' condition. + if: needs.setvar.outputs.release_run && github.ref_type == 'tag' steps: - uses: actions/download-artifact@v4 with: -- cgit v1.2.3 From 7e381d62a8e7f64f1bae96a8ef6b38316427381b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 16 May 2024 16:12:23 -0400 Subject: Try determining which-branch once for all platforms. --- .github/workflows/build.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b301e88f48..a33b4a88c7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,6 +21,8 @@ jobs: runs-on: ubuntu-latest outputs: release_run: ${{ steps.setvar.outputs.release_run }} + branch: ${{ steps.which-branch.outputs.branch }} + relnotes: ${{ steps.which-branch.outputs.relnotes }} env: # Build with a tag like "Second_Life#abcdef0" to generate a release page # (used for builds we are planning to deploy). @@ -35,6 +37,13 @@ jobs: run: | echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT" + - name: Determine source branch + id: which-branch + if: env.BUILD + uses: secondlife/viewer-build-util/which-branch@v2 + with: + token: ${{ github.token }} + build: needs: setvar strategy: @@ -52,8 +61,6 @@ jobs: outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} viewer_version: ${{ steps.build.outputs.viewer_version }} - viewer_branch: ${{ steps.which-branch.outputs.branch }} - relnotes: ${{ steps.which-branch.outputs.relnotes }} imagename: ${{ steps.build.outputs.imagename }} env: AUTOBUILD_ADDRSIZE: 64 @@ -136,19 +143,12 @@ jobs: 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 }} + AUTOBUILD_VCS_BRANCH: ${{ needs.setvar.outputs.branch }} RUNNER_OS: ${{ runner.os }} run: | # set up things the viewer's build.sh script expects @@ -437,7 +437,7 @@ jobs: Build ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} - ${{ needs.build.outputs.relnotes }} + ${{ needs.setvar.outputs.relnotes }} prerelease: true generate_release_notes: true target_commitish: ${{ github.sha }} -- cgit v1.2.3 From 006b00b47d8fc0ea89ca799c191b91d49d8f6bb6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 16 May 2024 16:23:35 -0400 Subject: Add diagnostic output to setvar build step. --- .github/workflows/build.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a33b4a88c7..5854a512d1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -35,11 +35,14 @@ jobs: id: setvar shell: bash run: | + echo "release_run = ${{ github.event.inputs.release_run }}" + echo "ref_type = ${{ github.ref_type }}" + echo "RELEASE_RUN = $RELEASE_RUN" echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT" + exit 1 - name: Determine source branch id: which-branch - if: env.BUILD uses: secondlife/viewer-build-util/which-branch@v2 with: token: ${{ github.token }} -- cgit v1.2.3 From 189711f41cb262a958ccdabfe9687caa4eb17e79 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 16 May 2024 16:27:35 -0400 Subject: Try harder to interpret github.event.inputs.release_run checkbox. --- .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 5854a512d1..27516aacf0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,7 +29,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.event.inputs.release_run || (github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life'))) && 'Y' || '' }} + RELEASE_RUN: ${{ (github.event.inputs.release_run != 'false' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life'))) && 'Y' || '' }} steps: - name: Set Variable id: setvar -- cgit v1.2.3 From fe14534c57b97c2ab3bfd9eade681f6a404f72a2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 16 May 2024 16:37:33 -0400 Subject: Fix test for github.event.inputs.release_run. --- .github/workflows/build.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 27516aacf0..4f35b2c813 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,20 +26,20 @@ jobs: env: # Build with a tag like "Second_Life#abcdef0" to generate a release page # (used for builds we are planning to deploy). + # Even though inputs.release_run is specified with type boolean, which + # correctly presents a checkbox, its *value* is a GH workflow string + # 'true' or 'false'. If you simply test github.event.inputs.release_run, + # it always evaluates as true because it's a non-empty string either way. # 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. + # its value when false is "false", which (again) is interpreted as true. RELEASE_RUN: ${{ (github.event.inputs.release_run != 'false' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life'))) && 'Y' || '' }} steps: - name: Set Variable id: setvar shell: bash run: | - echo "release_run = ${{ github.event.inputs.release_run }}" - echo "ref_type = ${{ github.ref_type }}" - echo "RELEASE_RUN = $RELEASE_RUN" echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT" - exit 1 - name: Determine source branch id: which-branch -- cgit v1.2.3