summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yaml35
1 files changed, 21 insertions, 14 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 8d1c6b63e6..f77d84be4f 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -21,13 +21,19 @@ 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).
+ # 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.
- RELEASE_RUN: ${{ (github.event.inputs.release_run || github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')) && 'Y' || '' }}
+ # 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
@@ -35,6 +41,12 @@ jobs:
run: |
echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT"
+ - name: Determine source branch
+ id: which-branch
+ uses: secondlife/viewer-build-util/which-branch@v2
+ with:
+ token: ${{ github.token }}
+
build:
needs: setvar
strategy:
@@ -52,8 +64,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 +146,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
@@ -403,7 +406,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:
@@ -433,7 +440,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 }}