From f71662225eadf1589f5331e763e02e0bb1b72137 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 31 Oct 2023 10:50:39 -0400 Subject: SL-20546: Add viewer channel and full version to GitHub release page. --- .github/workflows/build.yaml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1cd0c2526f..3a32a03b3f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -360,6 +360,11 @@ jobs: # name the release page for the build number so we can find it # easily (analogous to looking up a codeticket build page) name: "v${{ github.run_id }}" + # SL-20546: want the channel and version to be visible on the + # release page + body: | + ${{ needs.build.outputs.viewer_channel }} + ${{ needs.build.outputs.viewer_version }} prerelease: true generate_release_notes: true # the only reason we generate a GH release is to post build products -- cgit v1.2.3 From 9e99bb04a32f2ecc0f0b99686ce5a7adb356596d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Nov 2023 04:09:56 -0500 Subject: SL-20546: Append generated release notes body to our explicit body. For a tag build that generates a release page, try to deduce the git branch to which the tag we're building corresponds and add that to release notes. --- .github/workflows/build.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3a32a03b3f..895fb00506 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,6 +24,7 @@ jobs: outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} viewer_version: ${{ steps.build.outputs.viewer_version }} + viewer_branch: ${{ steps.build.outputs.viewer_branch }} imagename: ${{ steps.build.outputs.imagename }} env: AUTOBUILD_ADDRSIZE: 64 @@ -176,9 +177,17 @@ jobs: if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME:0:12}" == "Second_Life_" ]] then viewer_channel="${GITHUB_REF_NAME%#*}" export viewer_channel="${viewer_channel//_/ }" + # Since GITHUB_REF_NAME is a tag rather than a branch, we need + # to discover to what branch this tag corresponds. Get the tip + # commit (for the tag) and then ask for branches containing it. + # Assume GitHub cloned only this tag and its containing branch. + viewer_branch="$(git branch --contains "$(git log -n 1 --format=%h)" | + grep -v '(HEAD')" else export viewer_channel="Second Life Test" + viewer_branch="${GITHUB_REF_NAME}" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" + echo "viewer_branch=$viewer_branch" >> "$GITHUB_OUTPUT" # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module @@ -365,8 +374,10 @@ jobs: body: | ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} + ${{ needs.build.outputs.viewer_branch }} prerelease: true generate_release_notes: true + append_body: true # the only reason we generate a GH release is to post build products fail_on_unmatched_files: true files: "assets/*" -- cgit v1.2.3 From 59eeaed1187e7592fd83380045916f2d8b9d58e7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Nov 2023 14:20:51 -0500 Subject: SL-20546: Try harder to infer the branch corresponding to build tag. --- .github/workflows/build.yaml | 8 ++-- .github/workflows/which_branch.py | 77 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/which_branch.py (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 895fb00506..abf14b015e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -178,11 +178,9 @@ jobs: then viewer_channel="${GITHUB_REF_NAME%#*}" export viewer_channel="${viewer_channel//_/ }" # Since GITHUB_REF_NAME is a tag rather than a branch, we need - # to discover to what branch this tag corresponds. Get the tip - # commit (for the tag) and then ask for branches containing it. - # Assume GitHub cloned only this tag and its containing branch. - viewer_branch="$(git branch --contains "$(git log -n 1 --format=%h)" | - grep -v '(HEAD')" + # to discover to what branch this tag corresponds. + viewer_branch="$(python3 .github/workflows/which_branch.py \ + --token "${{ github.token }}" ${{ github.workflow_sha }})" else export viewer_channel="Second Life Test" viewer_branch="${GITHUB_REF_NAME}" fi diff --git a/.github/workflows/which_branch.py b/.github/workflows/which_branch.py new file mode 100644 index 0000000000..802ea44b5a --- /dev/null +++ b/.github/workflows/which_branch.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""\ +@file which_branch.py +@author Nat Goodspeed +@date 2023-11-14 +@brief Discover which git branch(es) correspond to a given commit hash. + +$LicenseInfo:firstyear=2023&license=viewerlgpl$ +Copyright (c) 2023, Linden Research, Inc. +$/LicenseInfo$ +""" + +import github +import re +import sys +import subprocess + +class Error(Exception): + pass + +def branches_for(token, commit, repo=None): + """ + Use the GitHub REST API to discover which branch(es) correspond to the + passed commit hash. The commit string can actually be any of the ways git + permits to identify a commit: + + https://git-scm.com/docs/gitrevisions#_specifying_revisions + + branches_for() generates a (possibly empty) sequence of all the branches + of the specified repo for which the specified commit is the tip. + + If repo is omitted or None, assume the current directory is a local clone + whose 'origin' remote is the GitHub repository of interest. + """ + if not repo: + url = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], + text=True) + parts = re.split(r'[:/]', url.rstrip()) + repo = '/'.join(parts[-2:]).removesuffix('.git') + + gh = github.MainClass.Github(token) + grepo = gh.get_repo(repo) + for branch in grepo.get_branches(): + try: + delta = grepo.compare(base=commit, head=branch.name) + except github.GithubException: + continue + + if delta.ahead_by == 0 and delta.behind_by == 0: + yield branch + +def main(*raw_args): + from argparse import ArgumentParser + parser = ArgumentParser(description= +"%(prog)s reports the branch(es) for which the specified commit hash is the tip.", + epilog="""\ +When GitHub Actions launches a tag build, it checks out the specific changeset +identified by the tag, and so 'git branch' reports detached HEAD. But we use +tag builds to build a GitHub 'release' of the tip of a particular branch, and +it's useful to be able to identify which branch that is. +""") + parser.add_argument('-t', '--token', required=True, + help="""GitHub REST API access token""") + parser.add_argument('-r', '--repo', + help="""GitHub repository name, in the form OWNER/REPOSITORY""") + parser.add_argument('commit', + help="""commit hash at the tip of the sought branch""") + + args = parser.parse_args(raw_args) + for branch in branches_for(token=args.token, commit=args.commit, repo=args.repo): + print(branch.name) + +if __name__ == "__main__": + try: + sys.exit(main(*sys.argv[1:])) + except Error as err: + sys.exit(str(err)) -- cgit v1.2.3 From 6654ad14eed674e894d2903e0f2ea37c4e806c0f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Nov 2023 14:30:44 -0500 Subject: SL-20546: Add PyGithub to installed Python packages. --- .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 abf14b015e..ebcabe40c2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -81,7 +81,7 @@ jobs: path: .master-message-template - name: Install autobuild and python dependencies - run: pip3 install autobuild llsd + run: pip3 install autobuild PyGithub llsd - name: Cache autobuild packages uses: actions/cache@v3 -- cgit v1.2.3 From 819604d2cee6d4527cc436bebfacddf8642635ff Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 Nov 2023 09:44:38 -0500 Subject: SL-20546: Make dependency on build job explicit, not indirect. The release job has been dependent on sign-and-package-windows and sign-and-package-mac, each of which depends on build. But that indirect dependency doesn't convey access to ${{ needs.build.outputs.xxx }}. Add the build job to direct dependencies so release can access its outputs. --- .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 ebcabe40c2..0f590ad3a2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -331,7 +331,7 @@ jobs: version: ${{ needs.build.outputs.viewer_version }} release: - needs: [sign-and-package-windows, sign-and-package-mac] + needs: [build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_') steps: -- cgit v1.2.3 From 96deda3f63ca12be734fb02e5f9406744bff3629 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 Nov 2023 09:52:06 -0500 Subject: SL-20546: build-variables viewer branch no longer exists. --- .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 0f590ad3a2..bfe1e1adb1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -71,7 +71,7 @@ jobs: uses: actions/checkout@v4 with: repository: secondlife/build-variables - ref: viewer + ref: master path: .build-variables - name: Checkout master-message-template -- cgit v1.2.3 From eff5958c11f2fcbb0449b8e011d4676a239bbe57 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 4 Dec 2023 08:26:09 +0100 Subject: Fix formatting in autobuild.xml (indents in close tags) --- .github/release.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to '.github') diff --git a/.github/release.yaml b/.github/release.yaml index 0f4884c944..f550e52020 100644 --- a/.github/release.yaml +++ b/.github/release.yaml @@ -1,18 +1,18 @@ -changelog: - exclude: - labels: - - ignore-for-release - authors: - - dependabot - categories: - - title: Breaking Changes 🛠 - labels: - - semver-major - - breaking-change - - title: New Features 🎉 - labels: - - semver-minor - - enhancement - - title: Other Changes - labels: - - '*' +changelog: + exclude: + labels: + - ignore-for-release + authors: + - dependabot + categories: + - title: Breaking Changes 🛠 + labels: + - semver-major + - breaking-change + - title: New Features 🎉 + labels: + - semver-minor + - enhancement + - title: Other Changes + labels: + - '*' -- cgit v1.2.3 From 6e8d4f48466a5bbad2fcc27bc2877a30e575d4ce Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 18 Dec 2023 10:59:03 -0500 Subject: DRTVWR-601: Make autobuild set vcs_url, vcs_branch, vcs_revision in viewer's autobuild-package.xml. Ensure that AUTOBUILD_VCS_BRANCH is set before the build. (cherry picked from commit b782ab73e640e434e4ed67fa8dfc951f09757585) --- .github/workflows/build.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d7f0daf8b3..da7e0b9809 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,6 +34,9 @@ jobs: AUTOBUILD_GITHUB_TOKEN: ${{ secrets.SHARED_AUTOBUILD_GITHUB_TOKEN }} AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables + # Direct autobuild to store vcs_url, vcs_branch and vcs_revision in + # autobuild-package.xml. + AUTOBUILD_VCS_INFO: "true" AUTOBUILD_VSVER: "170" DEVELOPER_DIR: ${{ matrix.developer_dir }} # Ensure that Linden viewer builds engage Bugsplat. @@ -199,6 +202,11 @@ jobs: fi export PYTHON_COMMAND_NATIVE="$(native_path "$PYTHON_COMMAND")" + # branch will be something like "origin/mybranch" + branch="$(git branch -r --contains ${{ github.event.pull_request.head.sha || github.sha }} | head -n 1)" + # strip off "origin/" + export AUTOBUILD_VCS_BRANCH="${branch#*/}" + ./build.sh # Each artifact is downloaded as a distinct .zip file. Multiple jobs -- cgit v1.2.3 From ff1741cecae0fac6d94507fa4a6e4662219af707 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 18 Dec 2023 17:35:23 -0500 Subject: DRTVWR-601: Use viewer-build-util/which-branch to determine branch. (cherry picked from commit 2c5066f1fcc0c9f145698ef3aaec72d27bce7181) --- .github/workflows/build.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index da7e0b9809..d21acccbd2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -100,10 +100,17 @@ jobs: if: runner.os == 'Windows' run: choco install nsis-unicode + - name: Determine source branch + id: which-branch + uses: secondlife/viewer-build-util/which-branch@v1 + with: + token: ${{ github.token }} + - name: Build id: build shell: bash env: + AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }} RUNNER_OS: ${{ runner.os }} run: | # set up things the viewer's build.sh script expects @@ -154,7 +161,7 @@ jobs: } repo_branch() { - git -C "$1" branch | grep '^* ' | cut -c 3- + echo "$AUTOBUILD_VCS_BRANCH" } record_dependencies_graph() { @@ -202,11 +209,6 @@ jobs: fi export PYTHON_COMMAND_NATIVE="$(native_path "$PYTHON_COMMAND")" - # branch will be something like "origin/mybranch" - branch="$(git branch -r --contains ${{ github.event.pull_request.head.sha || github.sha }} | head -n 1)" - # strip off "origin/" - export AUTOBUILD_VCS_BRANCH="${branch#*/}" - ./build.sh # Each artifact is downloaded as a distinct .zip file. Multiple jobs -- cgit v1.2.3 From 09f66828ba573515c3766cce32f4746b8189efcf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Jan 2024 13:34:40 -0500 Subject: SL-20546: Use branch for autobuild package as well as release page. which_branch.py has moved to viewer-build-util as a reusable action. --- .github/workflows/build.yaml | 8 +--- .github/workflows/which_branch.py | 77 --------------------------------------- 2 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 .github/workflows/which_branch.py (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d21acccbd2..deabdf9c1e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,7 +24,7 @@ jobs: outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} viewer_version: ${{ steps.build.outputs.viewer_version }} - viewer_branch: ${{ steps.build.outputs.viewer_branch }} + viewer_branch: ${{ steps.which-branch.outputs.branch }} imagename: ${{ steps.build.outputs.imagename }} env: AUTOBUILD_ADDRSIZE: 64 @@ -187,15 +187,9 @@ jobs: if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME:0:12}" == "Second_Life_" ]] then viewer_channel="${GITHUB_REF_NAME%#*}" export viewer_channel="${viewer_channel//_/ }" - # Since GITHUB_REF_NAME is a tag rather than a branch, we need - # to discover to what branch this tag corresponds. - viewer_branch="$(python3 .github/workflows/which_branch.py \ - --token "${{ github.token }}" ${{ github.workflow_sha }})" else export viewer_channel="Second Life Test" - viewer_branch="${GITHUB_REF_NAME}" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" - echo "viewer_branch=$viewer_branch" >> "$GITHUB_OUTPUT" # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module diff --git a/.github/workflows/which_branch.py b/.github/workflows/which_branch.py deleted file mode 100644 index 802ea44b5a..0000000000 --- a/.github/workflows/which_branch.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 -"""\ -@file which_branch.py -@author Nat Goodspeed -@date 2023-11-14 -@brief Discover which git branch(es) correspond to a given commit hash. - -$LicenseInfo:firstyear=2023&license=viewerlgpl$ -Copyright (c) 2023, Linden Research, Inc. -$/LicenseInfo$ -""" - -import github -import re -import sys -import subprocess - -class Error(Exception): - pass - -def branches_for(token, commit, repo=None): - """ - Use the GitHub REST API to discover which branch(es) correspond to the - passed commit hash. The commit string can actually be any of the ways git - permits to identify a commit: - - https://git-scm.com/docs/gitrevisions#_specifying_revisions - - branches_for() generates a (possibly empty) sequence of all the branches - of the specified repo for which the specified commit is the tip. - - If repo is omitted or None, assume the current directory is a local clone - whose 'origin' remote is the GitHub repository of interest. - """ - if not repo: - url = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], - text=True) - parts = re.split(r'[:/]', url.rstrip()) - repo = '/'.join(parts[-2:]).removesuffix('.git') - - gh = github.MainClass.Github(token) - grepo = gh.get_repo(repo) - for branch in grepo.get_branches(): - try: - delta = grepo.compare(base=commit, head=branch.name) - except github.GithubException: - continue - - if delta.ahead_by == 0 and delta.behind_by == 0: - yield branch - -def main(*raw_args): - from argparse import ArgumentParser - parser = ArgumentParser(description= -"%(prog)s reports the branch(es) for which the specified commit hash is the tip.", - epilog="""\ -When GitHub Actions launches a tag build, it checks out the specific changeset -identified by the tag, and so 'git branch' reports detached HEAD. But we use -tag builds to build a GitHub 'release' of the tip of a particular branch, and -it's useful to be able to identify which branch that is. -""") - parser.add_argument('-t', '--token', required=True, - help="""GitHub REST API access token""") - parser.add_argument('-r', '--repo', - help="""GitHub repository name, in the form OWNER/REPOSITORY""") - parser.add_argument('commit', - help="""commit hash at the tip of the sought branch""") - - args = parser.parse_args(raw_args) - for branch in branches_for(token=args.token, commit=args.commit, repo=args.repo): - print(branch.name) - -if __name__ == "__main__": - try: - sys.exit(main(*sys.argv[1:])) - except Error as err: - sys.exit(str(err)) -- cgit v1.2.3 From dd0ec112fe5ded8ed5f69b72b3df26343ca12d35 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Jan 2024 13:43:34 -0500 Subject: SL-20546: PyGithub was only needed for local which_branch.py. Now that which_branch.py has moved to viewer-build-util, so has the PyGithub dependency. --- .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 deabdf9c1e..19a6a0ef6f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -84,7 +84,7 @@ jobs: path: .master-message-template - name: Install autobuild and python dependencies - run: pip3 install autobuild PyGithub llsd + run: pip3 install autobuild llsd - name: Cache autobuild packages uses: actions/cache@v3 -- cgit v1.2.3 From 834cc3d1e094bdc9615e6ba46cf49c8c5db872d7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Jan 2024 15:21:15 -0500 Subject: SL-20546: Test new viewer-build-util branch pr-branch. --- .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 19a6a0ef6f..2e97d7c6dc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -102,7 +102,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@v1 + uses: secondlife/viewer-build-util/which-branch@pr-branch with: token: ${{ github.token }} -- cgit v1.2.3 From 6555fb3409fbdbd412a8062962c133af7aea7614 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Jan 2024 21:35:48 -0500 Subject: SL-20546: Use viewer-build-util@v1 instead of PR branch. The fix we wanted was on the pr-branch branch of the viewer-build-util repo. Now that it's been published as v1.1.2, the updated v1 tag references the fix, so revert mention to @v1. --- .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 2e97d7c6dc..19a6a0ef6f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -102,7 +102,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@pr-branch + uses: secondlife/viewer-build-util/which-branch@v1 with: token: ${{ github.token }} -- cgit v1.2.3 From ff543b744ee0b0fd4dd90b46419ae50a570572ab Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Feb 2024 11:21:31 -0500 Subject: Engage new viewer-build-util/which-branch with relnotes output. Put whatever release notes we retrieve into the generated release page. --- .github/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 19a6a0ef6f..73df01b8cf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,6 +25,7 @@ jobs: 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 @@ -102,7 +103,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@v1 + uses: secondlife/viewer-build-util/which-branch@relnotes with: token: ${{ github.token }} @@ -377,6 +378,7 @@ jobs: ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} ${{ needs.build.outputs.viewer_branch }} + ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true append_body: true -- cgit v1.2.3 From a908b4cfa98716d4a838fc1e5a6789faa15d16cf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 11:23:47 -0500 Subject: Try to generate release notes for this specific branch. Also try to cross-reference release page and build page. --- .github/workflows/build.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1bc74fe084..c78c8c656b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -367,25 +367,30 @@ jobs: mv newview/viewer_version.txt macOS-viewer_version.txt # forked from softprops/action-gh-release - - uses: secondlife-3p/action-gh-release@v1 + - name: Create GitHub release + id: release + uses: secondlife-3p/action-gh-release@v1 with: - # name the release page for the build number so we can find it - # easily (analogous to looking up a codeticket build page) - name: "v${{ github.run_id }}" + # name the release page for the branch + name: "${{ needs.build.outputs.viewer_branch }}" # SL-20546: want the channel and version to be visible on the # release page body: | + Build ${{ github.repositoryUrl }}/actions/runs/${{ github.run_id }} ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} - ${{ needs.build.outputs.viewer_branch }} ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true + target_commitish: ${{ github.ref }} append_body: true - # the only reason we generate a GH release is to post build products fail_on_unmatched_files: true files: | *.dmg *.exe *-autobuild-package.xml *-viewer_version.txt + + - name: post release URL + run: | + echo "::notice::Release ${{ steps.release.outputs.url }}" -- cgit v1.2.3 From c6a6db8488a8b3e7ea6534fbf5e2fe2b17864421 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 12:20:31 -0500 Subject: Try basing the GH release on github.ref_name instead of github.ref. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using github.ref as action-gh-release's target_commitish produces: ⚠️ GitHub release failed with status: 422 [{"resource":"Release","code":"invalid","field":"target_commitish"}] --- .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 c78c8c656b..622ceb4afe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -382,7 +382,7 @@ jobs: ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true - target_commitish: ${{ github.ref }} + target_commitish: ${{ github.ref_name }} append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 4edd78f2e54b3cd2e0b0a4b9300dfc669231dd98 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 13:26:29 -0500 Subject: Try basing release notes on github.sha rather than github.ref_name. --- .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 622ceb4afe..6f4325b9dd 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -382,7 +382,7 @@ jobs: ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true - target_commitish: ${{ github.ref_name }} + target_commitish: ${{ github.sha }} append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 88ebb92f05dade00cc8fc519cc062a458ecd48f2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 15:51:31 -0500 Subject: Leverage action-gh-release's new previous_tag input. This should (!) allow us to generate full release notes relative to the previous viewer release, instead of letting action-gh-release guess incorrectly. Also try again to add to the release page a back-link to the specific build. --- .github/workflows/build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6f4325b9dd..c903f1b8ce 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -369,20 +369,21 @@ jobs: # forked from softprops/action-gh-release - name: Create GitHub release id: release - uses: secondlife-3p/action-gh-release@v1 + uses: secondlife-3p/action-gh-release@feat/add-generateReleaseNotes with: # name the release page for the branch name: "${{ needs.build.outputs.viewer_branch }}" # SL-20546: want the channel and version to be visible on the # release page body: | - Build ${{ github.repositoryUrl }}/actions/runs/${{ github.run_id }} + 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 }} prerelease: true generate_release_notes: true target_commitish: ${{ github.sha }} + previous_tag: 7.1.2-release append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 27b298d8bc720ff315c8e74cc5bff9ff9ead0552 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 17:05:56 -0500 Subject: Base generated release notes on new floating tag 'release' instead of on the current tag 7.1.2-release. --- .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 c903f1b8ce..28310e54e2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -383,7 +383,7 @@ jobs: prerelease: true generate_release_notes: true target_commitish: ${{ github.sha }} - previous_tag: 7.1.2-release + previous_tag: release append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From b42e01d7acf5d4c55612c3a7df0e1ff6ee5ed951 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 28 Feb 2024 08:45:12 -0500 Subject: Reference updated action-gh-release@v1 instead of the branch that got pulled. --- .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 28310e54e2..321ba281cf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -369,7 +369,7 @@ jobs: # forked from softprops/action-gh-release - name: Create GitHub release id: release - uses: secondlife-3p/action-gh-release@feat/add-generateReleaseNotes + uses: secondlife-3p/action-gh-release@v1 with: # name the release page for the branch name: "${{ needs.build.outputs.viewer_branch }}" -- cgit v1.2.3 From e0ae227d0af39ee1c55d167d5091889f821ce124 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 31 Oct 2023 10:50:39 -0400 Subject: SL-20546: Add viewer channel and full version to GitHub release page. (cherry picked from commit f71662225eadf1589f5331e763e02e0bb1b72137) --- .github/workflows/build.yaml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1dd2c1d5df..9d04fbe87a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -360,6 +360,11 @@ jobs: # name the release page for the build number so we can find it # easily (analogous to looking up a codeticket build page) name: "v${{ github.run_id }}" + # SL-20546: want the channel and version to be visible on the + # release page + body: | + ${{ needs.build.outputs.viewer_channel }} + ${{ needs.build.outputs.viewer_version }} prerelease: true generate_release_notes: true # the only reason we generate a GH release is to post build products -- cgit v1.2.3 From cac7023996d691f00101429830a23b2cef3a2f83 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Nov 2023 04:09:56 -0500 Subject: SL-20546: Append generated release notes body to our explicit body. For a tag build that generates a release page, try to deduce the git branch to which the tag we're building corresponds and add that to release notes. (cherry picked from commit 9e99bb04a32f2ecc0f0b99686ce5a7adb356596d) --- .github/workflows/build.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9d04fbe87a..c0bec11275 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,6 +24,7 @@ jobs: outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} viewer_version: ${{ steps.build.outputs.viewer_version }} + viewer_branch: ${{ steps.build.outputs.viewer_branch }} imagename: ${{ steps.build.outputs.imagename }} env: AUTOBUILD_ADDRSIZE: 64 @@ -176,9 +177,17 @@ jobs: if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME:0:12}" == "Second_Life_" ]] then viewer_channel="${GITHUB_REF_NAME%#*}" export viewer_channel="${viewer_channel//_/ }" + # Since GITHUB_REF_NAME is a tag rather than a branch, we need + # to discover to what branch this tag corresponds. Get the tip + # commit (for the tag) and then ask for branches containing it. + # Assume GitHub cloned only this tag and its containing branch. + viewer_branch="$(git branch --contains "$(git log -n 1 --format=%h)" | + grep -v '(HEAD')" else export viewer_channel="Second Life Test" + viewer_branch="${GITHUB_REF_NAME}" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" + echo "viewer_branch=$viewer_branch" >> "$GITHUB_OUTPUT" # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module @@ -365,8 +374,10 @@ jobs: body: | ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} + ${{ needs.build.outputs.viewer_branch }} prerelease: true generate_release_notes: true + append_body: true # the only reason we generate a GH release is to post build products fail_on_unmatched_files: true files: | -- cgit v1.2.3 From a13e70aeffb87e2934f1b01f85dc2c78ea10e20c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Nov 2023 14:20:51 -0500 Subject: SL-20546: Try harder to infer the branch corresponding to build tag. (cherry picked from commit 59eeaed1187e7592fd83380045916f2d8b9d58e7) --- .github/workflows/build.yaml | 8 ++-- .github/workflows/which_branch.py | 77 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/which_branch.py (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c0bec11275..6c40c173db 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -178,11 +178,9 @@ jobs: then viewer_channel="${GITHUB_REF_NAME%#*}" export viewer_channel="${viewer_channel//_/ }" # Since GITHUB_REF_NAME is a tag rather than a branch, we need - # to discover to what branch this tag corresponds. Get the tip - # commit (for the tag) and then ask for branches containing it. - # Assume GitHub cloned only this tag and its containing branch. - viewer_branch="$(git branch --contains "$(git log -n 1 --format=%h)" | - grep -v '(HEAD')" + # to discover to what branch this tag corresponds. + viewer_branch="$(python3 .github/workflows/which_branch.py \ + --token "${{ github.token }}" ${{ github.workflow_sha }})" else export viewer_channel="Second Life Test" viewer_branch="${GITHUB_REF_NAME}" fi diff --git a/.github/workflows/which_branch.py b/.github/workflows/which_branch.py new file mode 100644 index 0000000000..802ea44b5a --- /dev/null +++ b/.github/workflows/which_branch.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""\ +@file which_branch.py +@author Nat Goodspeed +@date 2023-11-14 +@brief Discover which git branch(es) correspond to a given commit hash. + +$LicenseInfo:firstyear=2023&license=viewerlgpl$ +Copyright (c) 2023, Linden Research, Inc. +$/LicenseInfo$ +""" + +import github +import re +import sys +import subprocess + +class Error(Exception): + pass + +def branches_for(token, commit, repo=None): + """ + Use the GitHub REST API to discover which branch(es) correspond to the + passed commit hash. The commit string can actually be any of the ways git + permits to identify a commit: + + https://git-scm.com/docs/gitrevisions#_specifying_revisions + + branches_for() generates a (possibly empty) sequence of all the branches + of the specified repo for which the specified commit is the tip. + + If repo is omitted or None, assume the current directory is a local clone + whose 'origin' remote is the GitHub repository of interest. + """ + if not repo: + url = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], + text=True) + parts = re.split(r'[:/]', url.rstrip()) + repo = '/'.join(parts[-2:]).removesuffix('.git') + + gh = github.MainClass.Github(token) + grepo = gh.get_repo(repo) + for branch in grepo.get_branches(): + try: + delta = grepo.compare(base=commit, head=branch.name) + except github.GithubException: + continue + + if delta.ahead_by == 0 and delta.behind_by == 0: + yield branch + +def main(*raw_args): + from argparse import ArgumentParser + parser = ArgumentParser(description= +"%(prog)s reports the branch(es) for which the specified commit hash is the tip.", + epilog="""\ +When GitHub Actions launches a tag build, it checks out the specific changeset +identified by the tag, and so 'git branch' reports detached HEAD. But we use +tag builds to build a GitHub 'release' of the tip of a particular branch, and +it's useful to be able to identify which branch that is. +""") + parser.add_argument('-t', '--token', required=True, + help="""GitHub REST API access token""") + parser.add_argument('-r', '--repo', + help="""GitHub repository name, in the form OWNER/REPOSITORY""") + parser.add_argument('commit', + help="""commit hash at the tip of the sought branch""") + + args = parser.parse_args(raw_args) + for branch in branches_for(token=args.token, commit=args.commit, repo=args.repo): + print(branch.name) + +if __name__ == "__main__": + try: + sys.exit(main(*sys.argv[1:])) + except Error as err: + sys.exit(str(err)) -- cgit v1.2.3 From e4865db0cae7dc3b4e37543cb7cd57d357048340 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Nov 2023 14:30:44 -0500 Subject: SL-20546: Add PyGithub to installed Python packages. (cherry picked from commit 6654ad14eed674e894d2903e0f2ea37c4e806c0f) --- .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 6c40c173db..6704737409 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -81,7 +81,7 @@ jobs: path: .master-message-template - name: Install autobuild and python dependencies - run: pip3 install autobuild llsd + run: pip3 install autobuild PyGithub llsd - name: Cache autobuild packages uses: actions/cache@v3 -- cgit v1.2.3 From cfbef4e4f961cafaa004089e2055ff13de35b8dc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 15 Nov 2023 09:44:38 -0500 Subject: SL-20546: Make dependency on build job explicit, not indirect. The release job has been dependent on sign-and-package-windows and sign-and-package-mac, each of which depends on build. But that indirect dependency doesn't convey access to ${{ needs.build.outputs.xxx }}. Add the build job to direct dependencies so release can access its outputs. (cherry picked from commit 819604d2cee6d4527cc436bebfacddf8642635ff) --- .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 6704737409..861f1567c6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -331,7 +331,7 @@ jobs: version: ${{ needs.build.outputs.viewer_version }} release: - needs: [sign-and-package-windows, sign-and-package-mac] + needs: [build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_') steps: -- cgit v1.2.3 From 8590ce0533a4bc273b6c0094250fe31fc8e78f1f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 18 Dec 2023 10:59:03 -0500 Subject: DRTVWR-601: Make autobuild set vcs_url, vcs_branch, vcs_revision in viewer's autobuild-package.xml. Ensure that AUTOBUILD_VCS_BRANCH is set before the build. (cherry picked from commit b782ab73e640e434e4ed67fa8dfc951f09757585) (cherry picked from commit 6e8d4f48466a5bbad2fcc27bc2877a30e575d4ce) --- .github/workflows/build.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 861f1567c6..f127ac3f0f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,6 +34,9 @@ jobs: AUTOBUILD_GITHUB_TOKEN: ${{ secrets.SHARED_AUTOBUILD_GITHUB_TOKEN }} AUTOBUILD_INSTALLABLE_CACHE: ${{ github.workspace }}/.autobuild-installables AUTOBUILD_VARIABLES_FILE: ${{ github.workspace }}/.build-variables/variables + # Direct autobuild to store vcs_url, vcs_branch and vcs_revision in + # autobuild-package.xml. + AUTOBUILD_VCS_INFO: "true" AUTOBUILD_VSVER: "170" DEVELOPER_DIR: ${{ matrix.developer_dir }} # Ensure that Linden viewer builds engage Bugsplat. @@ -199,6 +202,11 @@ jobs: fi export PYTHON_COMMAND_NATIVE="$(native_path "$PYTHON_COMMAND")" + # branch will be something like "origin/mybranch" + branch="$(git branch -r --contains ${{ github.event.pull_request.head.sha || github.sha }} | head -n 1)" + # strip off "origin/" + export AUTOBUILD_VCS_BRANCH="${branch#*/}" + ./build.sh # Each artifact is downloaded as a distinct .zip file. Multiple jobs -- cgit v1.2.3 From 9b3d4325d9f049bc7315e3772eee2fb5e4bfc83a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 18 Dec 2023 17:35:23 -0500 Subject: DRTVWR-601: Use viewer-build-util/which-branch to determine branch. (cherry picked from commit 2c5066f1fcc0c9f145698ef3aaec72d27bce7181) (cherry picked from commit ff1741cecae0fac6d94507fa4a6e4662219af707) --- .github/workflows/build.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f127ac3f0f..f172883ae6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -100,10 +100,17 @@ jobs: if: runner.os == 'Windows' run: choco install nsis-unicode + - name: Determine source branch + id: which-branch + uses: secondlife/viewer-build-util/which-branch@v1 + with: + token: ${{ github.token }} + - name: Build id: build shell: bash env: + AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }} RUNNER_OS: ${{ runner.os }} run: | # set up things the viewer's build.sh script expects @@ -154,7 +161,7 @@ jobs: } repo_branch() { - git -C "$1" branch | grep '^* ' | cut -c 3- + echo "$AUTOBUILD_VCS_BRANCH" } record_dependencies_graph() { @@ -202,11 +209,6 @@ jobs: fi export PYTHON_COMMAND_NATIVE="$(native_path "$PYTHON_COMMAND")" - # branch will be something like "origin/mybranch" - branch="$(git branch -r --contains ${{ github.event.pull_request.head.sha || github.sha }} | head -n 1)" - # strip off "origin/" - export AUTOBUILD_VCS_BRANCH="${branch#*/}" - ./build.sh # Each artifact is downloaded as a distinct .zip file. Multiple jobs -- cgit v1.2.3 From 8f68199ccd4beeee827ff360e2f36871cedacdfe Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Jan 2024 13:34:40 -0500 Subject: SL-20546: Use branch for autobuild package as well as release page. which_branch.py has moved to viewer-build-util as a reusable action. (cherry picked from commit 09f66828ba573515c3766cce32f4746b8189efcf) --- .github/workflows/build.yaml | 8 +--- .github/workflows/which_branch.py | 77 --------------------------------------- 2 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 .github/workflows/which_branch.py (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f172883ae6..b323290f6b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,7 +24,7 @@ jobs: outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} viewer_version: ${{ steps.build.outputs.viewer_version }} - viewer_branch: ${{ steps.build.outputs.viewer_branch }} + viewer_branch: ${{ steps.which-branch.outputs.branch }} imagename: ${{ steps.build.outputs.imagename }} env: AUTOBUILD_ADDRSIZE: 64 @@ -187,15 +187,9 @@ jobs: if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME:0:12}" == "Second_Life_" ]] then viewer_channel="${GITHUB_REF_NAME%#*}" export viewer_channel="${viewer_channel//_/ }" - # Since GITHUB_REF_NAME is a tag rather than a branch, we need - # to discover to what branch this tag corresponds. - viewer_branch="$(python3 .github/workflows/which_branch.py \ - --token "${{ github.token }}" ${{ github.workflow_sha }})" else export viewer_channel="Second Life Test" - viewer_branch="${GITHUB_REF_NAME}" fi echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" - echo "viewer_branch=$viewer_branch" >> "$GITHUB_OUTPUT" # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module diff --git a/.github/workflows/which_branch.py b/.github/workflows/which_branch.py deleted file mode 100644 index 802ea44b5a..0000000000 --- a/.github/workflows/which_branch.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 -"""\ -@file which_branch.py -@author Nat Goodspeed -@date 2023-11-14 -@brief Discover which git branch(es) correspond to a given commit hash. - -$LicenseInfo:firstyear=2023&license=viewerlgpl$ -Copyright (c) 2023, Linden Research, Inc. -$/LicenseInfo$ -""" - -import github -import re -import sys -import subprocess - -class Error(Exception): - pass - -def branches_for(token, commit, repo=None): - """ - Use the GitHub REST API to discover which branch(es) correspond to the - passed commit hash. The commit string can actually be any of the ways git - permits to identify a commit: - - https://git-scm.com/docs/gitrevisions#_specifying_revisions - - branches_for() generates a (possibly empty) sequence of all the branches - of the specified repo for which the specified commit is the tip. - - If repo is omitted or None, assume the current directory is a local clone - whose 'origin' remote is the GitHub repository of interest. - """ - if not repo: - url = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], - text=True) - parts = re.split(r'[:/]', url.rstrip()) - repo = '/'.join(parts[-2:]).removesuffix('.git') - - gh = github.MainClass.Github(token) - grepo = gh.get_repo(repo) - for branch in grepo.get_branches(): - try: - delta = grepo.compare(base=commit, head=branch.name) - except github.GithubException: - continue - - if delta.ahead_by == 0 and delta.behind_by == 0: - yield branch - -def main(*raw_args): - from argparse import ArgumentParser - parser = ArgumentParser(description= -"%(prog)s reports the branch(es) for which the specified commit hash is the tip.", - epilog="""\ -When GitHub Actions launches a tag build, it checks out the specific changeset -identified by the tag, and so 'git branch' reports detached HEAD. But we use -tag builds to build a GitHub 'release' of the tip of a particular branch, and -it's useful to be able to identify which branch that is. -""") - parser.add_argument('-t', '--token', required=True, - help="""GitHub REST API access token""") - parser.add_argument('-r', '--repo', - help="""GitHub repository name, in the form OWNER/REPOSITORY""") - parser.add_argument('commit', - help="""commit hash at the tip of the sought branch""") - - args = parser.parse_args(raw_args) - for branch in branches_for(token=args.token, commit=args.commit, repo=args.repo): - print(branch.name) - -if __name__ == "__main__": - try: - sys.exit(main(*sys.argv[1:])) - except Error as err: - sys.exit(str(err)) -- cgit v1.2.3 From a8cd70123b075440c6343862349495421d12be45 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 18 Jan 2024 13:43:34 -0500 Subject: SL-20546: PyGithub was only needed for local which_branch.py. Now that which_branch.py has moved to viewer-build-util, so has the PyGithub dependency. (cherry picked from commit dd0ec112fe5ded8ed5f69b72b3df26343ca12d35) --- .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 b323290f6b..0cd5595e4b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -84,7 +84,7 @@ jobs: path: .master-message-template - name: Install autobuild and python dependencies - run: pip3 install autobuild PyGithub llsd + run: pip3 install autobuild llsd - name: Cache autobuild packages uses: actions/cache@v3 -- cgit v1.2.3 From 9f326f5b960b0d039280e4c04e7eb44fc094e40e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Feb 2024 11:21:31 -0500 Subject: Engage new viewer-build-util/which-branch with relnotes output. Put whatever release notes we retrieve into the generated release page. (cherry picked from commit ff543b744ee0b0fd4dd90b46419ae50a570572ab) --- .github/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0cd5595e4b..4d3dd31801 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,6 +25,7 @@ jobs: 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 @@ -102,7 +103,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@v1 + uses: secondlife/viewer-build-util/which-branch@relnotes with: token: ${{ github.token }} @@ -377,6 +378,7 @@ jobs: ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} ${{ needs.build.outputs.viewer_branch }} + ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true append_body: true -- cgit v1.2.3 From 603d3a865a0f619488555dd2d205e0eff4280cc5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 11:23:47 -0500 Subject: Try to generate release notes for this specific branch. Also try to cross-reference release page and build page. (cherry picked from commit a908b4cfa98716d4a838fc1e5a6789faa15d16cf) --- .github/workflows/build.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4d3dd31801..6713e429cc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -367,25 +367,30 @@ jobs: mv newview/viewer_version.txt macOS-viewer_version.txt # forked from softprops/action-gh-release - - uses: secondlife-3p/action-gh-release@v1 + - name: Create GitHub release + id: release + uses: secondlife-3p/action-gh-release@v1 with: - # name the release page for the build number so we can find it - # easily (analogous to looking up a codeticket build page) - name: "v${{ github.run_id }}" + # name the release page for the branch + name: "${{ needs.build.outputs.viewer_branch }}" # SL-20546: want the channel and version to be visible on the # release page body: | + Build ${{ github.repositoryUrl }}/actions/runs/${{ github.run_id }} ${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }} - ${{ needs.build.outputs.viewer_branch }} ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true + target_commitish: ${{ github.ref }} append_body: true - # the only reason we generate a GH release is to post build products fail_on_unmatched_files: true files: | *.dmg *.exe *-autobuild-package.xml *-viewer_version.txt + + - name: post release URL + run: | + echo "::notice::Release ${{ steps.release.outputs.url }}" -- cgit v1.2.3 From d7e6a7dbd057e03984583f4524953f8ae5250f17 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 12:20:31 -0500 Subject: Try basing the GH release on github.ref_name instead of github.ref. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using github.ref as action-gh-release's target_commitish produces: ⚠️ GitHub release failed with status: 422 [{"resource":"Release","code":"invalid","field":"target_commitish"}] (cherry picked from commit c6a6db8488a8b3e7ea6534fbf5e2fe2b17864421) --- .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 6713e429cc..b156133799 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -382,7 +382,7 @@ jobs: ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true - target_commitish: ${{ github.ref }} + target_commitish: ${{ github.ref_name }} append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 7c52db381c61f10aa5e4e9c5414c54c0e49d5815 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 13:26:29 -0500 Subject: Try basing release notes on github.sha rather than github.ref_name. (cherry picked from commit 4edd78f2e54b3cd2e0b0a4b9300dfc669231dd98) --- .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 b156133799..1816e8b48f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -382,7 +382,7 @@ jobs: ${{ needs.build.outputs.relnotes }} prerelease: true generate_release_notes: true - target_commitish: ${{ github.ref_name }} + target_commitish: ${{ github.sha }} append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 7ad13c851198d3ea2692c0c16f2eb844ebca8bf5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 15:51:31 -0500 Subject: Leverage action-gh-release's new previous_tag input. This should (!) allow us to generate full release notes relative to the previous viewer release, instead of letting action-gh-release guess incorrectly. Also try again to add to the release page a back-link to the specific build. (cherry picked from commit 88ebb92f05dade00cc8fc519cc062a458ecd48f2) --- .github/workflows/build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1816e8b48f..f76d4286e2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -369,20 +369,21 @@ jobs: # forked from softprops/action-gh-release - name: Create GitHub release id: release - uses: secondlife-3p/action-gh-release@v1 + uses: secondlife-3p/action-gh-release@feat/add-generateReleaseNotes with: # name the release page for the branch name: "${{ needs.build.outputs.viewer_branch }}" # SL-20546: want the channel and version to be visible on the # release page body: | - Build ${{ github.repositoryUrl }}/actions/runs/${{ github.run_id }} + 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 }} prerelease: true generate_release_notes: true target_commitish: ${{ github.sha }} + previous_tag: 7.1.2-release append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 3ee3e011ffe2b0d0810f61b5d35afb24ee4095a0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 26 Feb 2024 17:05:56 -0500 Subject: Base generated release notes on new floating tag 'release' instead of on the current tag 7.1.2-release. (cherry picked from commit 27b298d8bc720ff315c8e74cc5bff9ff9ead0552) --- .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 f76d4286e2..b3dafd43c9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -383,7 +383,7 @@ jobs: prerelease: true generate_release_notes: true target_commitish: ${{ github.sha }} - previous_tag: 7.1.2-release + previous_tag: release append_body: true fail_on_unmatched_files: true files: | -- cgit v1.2.3 From 00d7fef75ed860596ab87904209a827fd9de867e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 28 Feb 2024 08:45:12 -0500 Subject: Reference updated action-gh-release@v1 instead of the branch that got pulled. (cherry picked from commit b42e01d7acf5d4c55612c3a7df0e1ff6ee5ed951) --- .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 b3dafd43c9..8b08bb3960 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -369,7 +369,7 @@ jobs: # forked from softprops/action-gh-release - name: Create GitHub release id: release - uses: secondlife-3p/action-gh-release@feat/add-generateReleaseNotes + uses: secondlife-3p/action-gh-release@v1 with: # name the release page for the branch name: "${{ needs.build.outputs.viewer_branch }}" -- cgit v1.2.3 From 9b8800f216fb0a6efa80b76ca15d0491bd9948ee Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 1 Mar 2024 16:43:15 -0500 Subject: Now that viewer-build-util@relnotes has merged to v1, use @v1. --- .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 8b08bb3960..df49f5fa42 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -103,7 +103,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@relnotes + uses: secondlife/viewer-build-util/which-branch@v1 with: token: ${{ github.token }} -- cgit v1.2.3 From e07bf1c0a27cfb37c67c5ffdc92bb92975eabbbf Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Mon, 4 Mar 2024 17:32:35 -0800 Subject: Do not automatically close issues (#929) Mark issues as stale but do not close them. --- .github/workflows/stale.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 35ac41420c..e44e223589 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -17,7 +17,8 @@ jobs: with: stale-pr-message: This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or it will be closed in 7 days days-before-stale: 30 - days-before-close: 7 + days-before-close: 7 + days-before-issue-close: -1 exempt-pr-labels: blocked,must,should,keep stale-pr-label: stale - name: Print outputs -- cgit v1.2.3 From 6328cb7817174765d068685f67809108eb64f2b1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 5 Mar 2024 13:36:18 -0500 Subject: Make signing and symbol posting jobs conditional on secrets. Specifically, when secrets aren't available (e.g. for external PRs), skip the affected steps. --- .github/workflows/build.yaml | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1dd2c1d5df..edb180a2d1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -250,6 +250,7 @@ jobs: ${{ steps.build.outputs.physicstpv }} sign-and-package-windows: + if: secrets.AZURE_KEY_VAULT_URI && secrets.AZURE_CERT_NAME && secrets.AZURE_CLIENT_ID && secrets.AZURE_CLIENT_SECRET && secrets.AZURE_TENANT_ID needs: build runs-on: windows steps: @@ -263,6 +264,7 @@ jobs: tenant_id: "${{ secrets.AZURE_TENANT_ID }}" sign-and-package-mac: + if: secrets.NOTARIZE_CREDS_MACOS && secrets.SIGNING_CERT_MACOS && secrets.SIGNING_CERT_MACOS_IDENTITY && secrets.SIGNING_CERT_MACOS_PASSWORD needs: build runs-on: macos-latest steps: @@ -298,6 +300,7 @@ jobs: note_team: ${{ steps.note-creds.outputs.note_team }} post-windows-symbols: + if: secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS needs: build runs-on: ubuntu-latest steps: @@ -311,6 +314,7 @@ jobs: version: ${{ needs.build.outputs.viewer_version }} post-mac-symbols: + if: secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS needs: build runs-on: ubuntu-latest steps: -- cgit v1.2.3 From 73a12f5529cd6646b4d0a19ac3de15dc3a3570a6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 5 Mar 2024 13:50:38 -0500 Subject: Enclose 'if:' expressions in ${{ ... }}. The previous construct produced: Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.AZURE_KEY_VAULT_URI && ... --- .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 edb180a2d1..5fad232203 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -250,7 +250,7 @@ jobs: ${{ steps.build.outputs.physicstpv }} sign-and-package-windows: - if: secrets.AZURE_KEY_VAULT_URI && secrets.AZURE_CERT_NAME && secrets.AZURE_CLIENT_ID && secrets.AZURE_CLIENT_SECRET && secrets.AZURE_TENANT_ID + if: ${{ secrets.AZURE_KEY_VAULT_URI && secrets.AZURE_CERT_NAME && secrets.AZURE_CLIENT_ID && secrets.AZURE_CLIENT_SECRET && secrets.AZURE_TENANT_ID }} needs: build runs-on: windows steps: @@ -264,7 +264,7 @@ jobs: tenant_id: "${{ secrets.AZURE_TENANT_ID }}" sign-and-package-mac: - if: secrets.NOTARIZE_CREDS_MACOS && secrets.SIGNING_CERT_MACOS && secrets.SIGNING_CERT_MACOS_IDENTITY && secrets.SIGNING_CERT_MACOS_PASSWORD + if: ${{ secrets.NOTARIZE_CREDS_MACOS && secrets.SIGNING_CERT_MACOS && secrets.SIGNING_CERT_MACOS_IDENTITY && secrets.SIGNING_CERT_MACOS_PASSWORD }} needs: build runs-on: macos-latest steps: @@ -300,7 +300,7 @@ jobs: note_team: ${{ steps.note-creds.outputs.note_team }} post-windows-symbols: - if: secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS + if: ${{ secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS }} needs: build runs-on: ubuntu-latest steps: @@ -314,7 +314,7 @@ jobs: version: ${{ needs.build.outputs.viewer_version }} post-mac-symbols: - if: secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS + if: ${{ secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS }} needs: build runs-on: ubuntu-latest steps: -- cgit v1.2.3 From 74ee07d94268a76bcf24dfc0063fb5b6964ed607 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 5 Mar 2024 14:23:32 -0500 Subject: To test for presence of secrets, set environment variables. From https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#using-secrets-in-a-workflow : "Secrets cannot be directly referenced in if: conditionals. Instead, consider setting secrets as job-level environment variables, then referencing the environment variables to conditionally run steps in the job." --- .github/workflows/build.yaml | 54 ++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 19 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5fad232203..13798fc607 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,8 +37,6 @@ jobs: DEVELOPER_DIR: ${{ matrix.developer_dir }} # Ensure that Linden viewer builds engage Bugsplat. BUGSPLAT_DB: ${{ matrix.configuration != 'ReleaseOS' && 'SecondLife_Viewer_2018' || '' }} - BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} - BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} build_coverity: false build_log_dir: ${{ github.workspace }}/.logs build_viewer: true @@ -250,25 +248,36 @@ jobs: ${{ steps.build.outputs.physicstpv }} sign-and-package-windows: - if: ${{ secrets.AZURE_KEY_VAULT_URI && secrets.AZURE_CERT_NAME && secrets.AZURE_CLIENT_ID && secrets.AZURE_CLIENT_SECRET && secrets.AZURE_TENANT_ID }} + env: + AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} + AZURE_CERT_NAME: ${{ secrets.AZURE_CERT_NAME }} + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} needs: build runs-on: windows steps: - name: Sign and package Windows viewer + if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID uses: secondlife/viewer-build-util/sign-pkg-windows@v1 with: - vault_uri: "${{ secrets.AZURE_KEY_VAULT_URI }}" - cert_name: "${{ secrets.AZURE_CERT_NAME }}" - client_id: "${{ secrets.AZURE_CLIENT_ID }}" - client_secret: "${{ secrets.AZURE_CLIENT_SECRET }}" - tenant_id: "${{ secrets.AZURE_TENANT_ID }}" + vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}" + cert_name: "${{ env.AZURE_CERT_NAME }}" + client_id: "${{ env.AZURE_CLIENT_ID }}" + client_secret: "${{ env.AZURE_CLIENT_SECRET }}" + tenant_id: "${{ env.AZURE_TENANT_ID }}" sign-and-package-mac: - if: ${{ secrets.NOTARIZE_CREDS_MACOS && secrets.SIGNING_CERT_MACOS && secrets.SIGNING_CERT_MACOS_IDENTITY && secrets.SIGNING_CERT_MACOS_PASSWORD }} + env: + NOTARIZE_CREDS_MACOS: ${{ secrets.NOTARIZE_CREDS_MACOS }} + SIGNING_CERT_MACOS: ${{ secrets.SIGNING_CERT_MACOS }} + SIGNING_CERT_MACOS_IDENTITY: ${{ secrets.SIGNING_CERT_MACOS_IDENTITY }} + SIGNING_CERT_MACOS_PASSWORD: ${{ secrets.SIGNING_CERT_MACOS_PASSWORD }} needs: build runs-on: macos-latest steps: - name: Unpack Mac notarization credentials + if: env.NOTARIZE_CREDS_MACOS id: note-creds shell: bash run: | @@ -276,7 +285,7 @@ jobs: # USERNAME="..." # PASSWORD="..." # TEAM_ID="..." - eval "${{ secrets.NOTARIZE_CREDS_MACOS }}" + eval "${{ env.NOTARIZE_CREDS_MACOS }}" echo "::add-mask::$USERNAME" echo "::add-mask::$PASSWORD" echo "::add-mask::$TEAM_ID" @@ -288,41 +297,48 @@ jobs: [[ -n "$USERNAME" && -n "$PASSWORD" && -n "$TEAM_ID" ]] - name: Sign and package Mac viewer + if: env.SIGNING_CERT_MACOS && env.SIGNING_CERT_MACOS_IDENTITY && env.SIGNING_CERT_MACOS_PASSWORD && steps.note-creds.outputs.note_user && steps.note-creds.outputs.note_pass && steps.note-creds.outputs.note_team uses: secondlife/viewer-build-util/sign-pkg-mac@v1 with: channel: ${{ needs.build.outputs.viewer_channel }} imagename: ${{ needs.build.outputs.imagename }} - cert_base64: ${{ secrets.SIGNING_CERT_MACOS }} - cert_name: ${{ secrets.SIGNING_CERT_MACOS_IDENTITY }} - cert_pass: ${{ secrets.SIGNING_CERT_MACOS_PASSWORD }} + cert_base64: ${{ env.SIGNING_CERT_MACOS }} + cert_name: ${{ env.SIGNING_CERT_MACOS_IDENTITY }} + cert_pass: ${{ env.SIGNING_CERT_MACOS_PASSWORD }} note_user: ${{ steps.note-creds.outputs.note_user }} note_pass: ${{ steps.note-creds.outputs.note_pass }} note_team: ${{ steps.note-creds.outputs.note_team }} post-windows-symbols: - if: ${{ secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS }} + env: + BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} + BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} needs: build runs-on: ubuntu-latest steps: - name: Post Windows symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: secondlife/viewer-build-util/post-bugsplat-windows@v1 with: - username: ${{ secrets.BUGSPLAT_USER }} - password: ${{ secrets.BUGSPLAT_PASS }} + username: ${{ env.BUGSPLAT_USER }} + password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" channel: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} post-mac-symbols: - if: ${{ secrets.BUGSPLAT_USER && secrets.BUGSPLAT_PASS }} + env: + BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} + BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} needs: build runs-on: ubuntu-latest steps: - name: Post Mac symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: secondlife/viewer-build-util/post-bugsplat-mac@v1 with: - username: ${{ secrets.BUGSPLAT_USER }} - password: ${{ secrets.BUGSPLAT_PASS }} + username: ${{ env.BUGSPLAT_USER }} + password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" channel: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} -- cgit v1.2.3 From 231062d5323eca322c67c7132f96a1d402c0036c Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Tue, 12 Mar 2024 17:49:19 -0700 Subject: Fix github actions dependency deprecations --- .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 13798fc607..078eb1f1b8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -60,7 +60,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -81,7 +81,7 @@ jobs: run: pip3 install autobuild llsd - name: Cache autobuild packages - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-installables with: path: .autobuild-installables -- cgit v1.2.3 From 7fa24d636e42c19baf8a9a6fc4bf9b554dca0e3a Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Thu, 11 Apr 2024 00:16:17 -0700 Subject: CI: Remove python-version from matrix Drop python version from matrix configuration as it's always 3.11. --- .github/workflows/build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ddb0f44150..f18b31ef0f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,6 @@ jobs: matrix: runner: [windows-large, macos-12-xl] configuration: [Release, ReleaseOS] - python-version: ["3.11"] include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" @@ -67,7 +66,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.11" - name: Checkout build variables uses: actions/checkout@v4 -- cgit v1.2.3 From 0f94ea86d44f56ace4160eabceafe07a1f11784f Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Thu, 11 Apr 2024 13:32:48 -0700 Subject: CI: adopt xz compression Move towards packaging artifacts with xz, which offers higher compression ratios and faster decode time. --- .github/workflows/build.yaml | 58 +++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f18b31ef0f..44f32c1c5d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,13 +12,10 @@ jobs: strategy: matrix: runner: [windows-large, macos-12-xl] - configuration: [Release, ReleaseOS] + configuration: [Release] include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" - exclude: - - runner: macos-12-xl - configuration: ReleaseOS runs-on: ${{ matrix.runner }} outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} @@ -100,7 +97,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@v1 + uses: secondlife/viewer-build-util/which-branch@v2 with: token: ${{ github.token }} @@ -223,7 +220,7 @@ jobs: - name: Upload executable if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.viewer_app - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-app" path: | @@ -233,7 +230,7 @@ jobs: # artifact for that too. - name: Upload symbol file if: matrix.configuration != 'ReleaseOS' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-symbols" path: | @@ -241,7 +238,7 @@ jobs: - name: Upload metadata if: matrix.configuration != 'ReleaseOS' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-metadata" # emitted by build.sh, possibly multiple lines @@ -249,7 +246,7 @@ jobs: ${{ steps.build.outputs.metadata }} - name: Upload physics package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 # should only be set for viewer-private if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.physicstpv with: @@ -270,7 +267,7 @@ jobs: steps: - name: Sign and package Windows viewer if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID - uses: secondlife/viewer-build-util/sign-pkg-windows@v1 + uses: secondlife/viewer-build-util/sign-pkg-windows@v2 with: vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}" cert_name: "${{ env.AZURE_CERT_NAME }}" @@ -309,7 +306,7 @@ jobs: - name: Sign and package Mac viewer if: env.SIGNING_CERT_MACOS && env.SIGNING_CERT_MACOS_IDENTITY && env.SIGNING_CERT_MACOS_PASSWORD && steps.note-creds.outputs.note_user && steps.note-creds.outputs.note_pass && steps.note-creds.outputs.note_team - uses: secondlife/viewer-build-util/sign-pkg-mac@v1 + uses: secondlife/viewer-build-util/sign-pkg-mac@v2 with: channel: ${{ needs.build.outputs.viewer_channel }} imagename: ${{ needs.build.outputs.imagename }} @@ -329,7 +326,7 @@ jobs: steps: - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife/viewer-build-util/post-bugsplat-windows@v1 + uses: secondlife/viewer-build-util/post-bugsplat-windows@v2 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} @@ -346,7 +343,7 @@ jobs: steps: - name: Post Mac symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife/viewer-build-util/post-bugsplat-mac@v1 + uses: secondlife/viewer-build-util/post-bugsplat-mac@v2 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} @@ -359,31 +356,20 @@ jobs: runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_') steps: - - uses: actions/download-artifact@v3 - with: - name: Windows-installer - - - uses: actions/download-artifact@v3 - with: - name: macOS-installer - - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: Windows-metadata - - - name: Rename windows metadata - run: | - mv autobuild-package.xml Windows-autobuild-package.xml - mv newview/viewer_version.txt Windows-viewer_version.txt + pattern: "*-installer" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: macOS-metadata - - - name: Rename macOS metadata + pattern: "*-metadata" + + - name: Rename metadata run: | - mv autobuild-package.xml macOS-autobuild-package.xml - mv newview/viewer_version.txt macOS-viewer_version.txt + cp Windows-metadata/autobuild-package.xml Windows-autobuild-package.xml + cp Windows-metadata/newview/viewer_version.txt Windows-viewer_version.txt + cp macOS-metadata/autobuild-package.xml macOS-autobuild-package.xml + cp macOS-metadata/newview/viewer_version.txt macOS-viewer_version.txt # forked from softprops/action-gh-release - name: Create GitHub release @@ -406,8 +392,8 @@ jobs: append_body: true fail_on_unmatched_files: true files: | - *.dmg - *.exe + macOS-installer/*.dmg + Windows-installer/*.exe *-autobuild-package.xml *-viewer_version.txt -- cgit v1.2.3 From b340042a3f20b516d482e72e423ff4b00e085e1f Mon Sep 17 00:00:00 2001 From: Vir Linden <60274682+vir-linden@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:19:09 -0400 Subject: https://github.com/secondlife/viewer/issues/1214 - Update cla.yaml --- .github/workflows/cla.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml index b4b2565889..3f4bf21864 100644 --- a/.github/workflows/cla.yaml +++ b/.github/workflows/cla.yaml @@ -19,7 +19,7 @@ jobs: PERSONAL_ACCESS_TOKEN: ${{ secrets.SHARED_CLA_TOKEN }} with: branch: main - path-to-document: https://github.com/secondlife/cla/blob/master/CLA.md + path-to-document: https://github.com/secondlife/cla/blob/main/CLA.md path-to-signatures: signatures.json remote-organization-name: secondlife remote-repository-name: cla-signatures -- cgit v1.2.3 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