summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yaml37
1 files changed, 25 insertions, 12 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 44f32c1c5d..813b6a96ef 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:
@@ -58,8 +58,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@v5
with:
@@ -176,16 +181,23 @@ 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
+ branch=${{ github.repository }}
+ echo "branch=$branch" >> "$GITHUB_OUTPUT"
+ IFS='/' read -ra ba <<< $branch
+ username=${ba[0]}
+ prefix=${ba[1]}
+ 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')
+ 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"
-
# 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.
@@ -354,7 +366,8 @@ jobs:
release:
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_')
+ # 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@v4
with: