Skip to content

Commit

Permalink
#1286 - determine viewer_channel from branch name in builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vir-linden committed Apr 19, 2024
1 parent 255bb85 commit c2730b4
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
push:
branches: ["main", "release/*", "project/*"]
tags: ["Second_Life_*"]
tags: ["Second_Life*"]

jobs:
build:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c2730b4

Please sign in to comment.