summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorVir Linden <60274682+vir-linden@users.noreply.github.com>2024-04-19 16:44:59 +0100
committerVir Linden <60274682+vir-linden@users.noreply.github.com>2024-04-19 16:44:59 +0100
commitc2730b4fffe580bc99f29f1ba37aa45427f99b93 (patch)
treecf93620b99c4fbb5c0e1ab12a85fad172eee0d41 /.github/workflows
parent255bb8504d6191358bd94e838d2f9e5360577128 (diff)
https://github.com/secondlife/viewer/issues/1286 - determine viewer_channel from branch name in builds
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yaml24
1 files changed, 15 insertions, 9 deletions
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: