summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-08-13 15:32:47 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-08-13 15:32:47 -0400
commit23f2631d598b6e07450a96ed1ec00670c8867cdd (patch)
tree20195c1688ad8cb7e8631c97fa5920624f10972c /.github/workflows
parent54334ff6e377e35c97df3a0fe2a859795ec07b21 (diff)
parent8ce3323269d95f54e2b768c4c5aa154d4afbbb6b (diff)
Merge branch 'develop' into nat/edu-channel
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yaml111
-rw-r--r--.github/workflows/stale.yaml2
-rw-r--r--.github/workflows/tag-release.yaml47
3 files changed, 107 insertions, 53 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index dd78c46964..f945ec82c1 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -1,26 +1,20 @@
name: Build
on:
- workflow_dispatch:
- inputs:
- release_run:
- type: boolean
- description: Do a release of this build
- default: false
pull_request:
push:
branches: ["main", "release/*", "project/*"]
tags: ["Second_Life*"]
jobs:
- # The whole point of the setvar job is that we want to set a variable once
- # that will be consumed by multiple subsequent jobs. We tried setting it in
- # the global env, but a job.env can't directly reference the global env
- # context.
- setvar:
+ # The whole point of the setup job is that we want to set variables once
+ # that will be consumed by multiple subsequent jobs.
+ setup:
runs-on: ubuntu-latest
outputs:
release_run: ${{ steps.setvar.outputs.release_run }}
+ configurations: ${{ steps.setvar.outputs.configurations }}
+ bugsplat_db: ${{ steps.setvar.outputs.bugsplat_db }}
env:
# Build with a tag like "Second_Life#abcdef0" to generate a release page
# (used for builds we are planning to deploy).
@@ -28,33 +22,36 @@ jobs:
# important to ensure it's the empty string when false. If you omit || '',
# its value when false is "false", which is interpreted as true.
RELEASE_RUN: ${{ (github.event.inputs.release_run || github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')) && 'Y' || '' }}
+ FROM_FORK: ${{ github.event.pull_request.head.repo.fork }}
steps:
- - name: Set Variable
+ - name: Set Variables
id: setvar
shell: bash
run: |
echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT"
+ if [[ "$FROM_FORK" == "true" ]]; then
+ # PR from fork; don't build with Bugsplat, proprietary libs
+ echo 'configurations=["ReleaseOS"]' >> $GITHUB_OUTPUT
+ echo "bugsplat_db=" >> $GITHUB_OUTPUT
+ else
+ echo 'configurations=["Release"]' >> $GITHUB_OUTPUT
+ echo "bugsplat_db=SecondLife_Viewer_2018" >> $GITHUB_OUTPUT
+ fi
build:
- needs: setvar
+ needs: setup
strategy:
matrix:
runner: [windows-large, macos-12-xl]
- configuration: [Release]
- Linden: [true]
- include:
- - runner: macos-12-xl
- developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
- - runner: windows-large
- configuration: ReleaseOS
- Linden: false
+ configuration: ${{ fromJSON(needs.setup.outputs.configurations) }}
runs-on: ${{ matrix.runner }}
outputs:
viewer_channel: ${{ steps.build.outputs.viewer_channel }}
viewer_version: ${{ steps.build.outputs.viewer_version }}
viewer_branch: ${{ steps.which-branch.outputs.branch }}
relnotes: ${{ steps.which-branch.outputs.relnotes }}
- imagename: ${{ steps.build.outputs.imagename }}
+ imagename: ${{ steps.build.outputs.imagename }}
+ configuration: ${{ matrix.configuration }}
env:
AUTOBUILD_ADDRSIZE: 64
AUTOBUILD_BUILD_ID: ${{ github.run_id }}
@@ -67,12 +64,9 @@ jobs:
# autobuild-package.xml.
AUTOBUILD_VCS_INFO: "true"
AUTOBUILD_VSVER: "170"
- DEVELOPER_DIR: ${{ matrix.developer_dir }}
+ DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
# Ensure that Linden viewer builds engage Bugsplat.
- BUGSPLAT_DB: ${{ matrix.Linden && 'SecondLife_Viewer_2018' || '' }}
- # Run BUILD steps for Release configuration.
- # Run BUILD steps for ReleaseOS configuration only for release runs.
- BUILD: ${{ (matrix.Linden || needs.setvar.outputs.release_run) && 'Y' || '' }}
+ BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }}
build_coverity: false
build_log_dir: ${{ github.workspace }}/.logs
build_viewer: true
@@ -91,19 +85,16 @@ jobs:
variants: ${{ matrix.configuration }}
steps:
- name: Checkout code
- if: env.BUILD
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup python
- if: env.BUILD
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Checkout build variables
- if: env.BUILD
uses: actions/checkout@v4
with:
repository: secondlife/build-variables
@@ -111,19 +102,16 @@ jobs:
path: .build-variables
- name: Checkout master-message-template
- if: env.BUILD
uses: actions/checkout@v4
with:
repository: secondlife/master-message-template
path: .master-message-template
- name: Install autobuild and python dependencies
- if: env.BUILD
run: pip3 install autobuild llsd
- name: Cache autobuild packages
id: cache-installables
- if: env.BUILD
uses: actions/cache@v4
with:
path: .autobuild-installables
@@ -132,20 +120,14 @@ jobs:
${{ runner.os }}-64-${{ matrix.configuration }}-
${{ runner.os }}-64-
- - name: Install windows dependencies
- if: env.BUILD && runner.os == 'Windows'
- run: choco install nsis-unicode
-
- name: Determine source branch
id: which-branch
- if: env.BUILD
uses: secondlife/viewer-build-util/which-branch@v2
with:
token: ${{ github.token }}
- name: Build
id: build
- if: env.BUILD
shell: bash
env:
AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }}
@@ -227,6 +209,9 @@ jobs:
if [[ "$edu" == "true" ]]
then
export viewer_channel="Second Life Release edu"
+ elif [[ "$branch" == "develop" ]];
+ then
+ export viewer_channel="Second Life Develop"
else
branch=$AUTOBUILD_VCS_BRANCH
IFS='/' read -ra ba <<< "$branch"
@@ -277,7 +262,7 @@ jobs:
echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT
- name: Upload executable
- if: matrix.Linden && steps.build.outputs.viewer_app
+ if: steps.build.outputs.viewer_app
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-app"
@@ -287,15 +272,12 @@ jobs:
# The other upload of nontrivial size is the symbol file. Use a distinct
# artifact for that too.
- name: Upload symbol file
- if: matrix.Linden
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-symbols"
- path: |
- ${{ steps.build.outputs.symbolfile }}
+ path: ${{ steps.build.outputs.symbolfile }}
- name: Upload metadata
- if: matrix.Linden
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-metadata"
@@ -306,7 +288,7 @@ jobs:
- name: Upload physics package
uses: actions/upload-artifact@v4
# should only be set for viewer-private
- if: matrix.Linden && steps.build.outputs.physicstpv
+ if: matrix.configuration == 'Release' && steps.build.outputs.physicstpv
with:
name: "${{ steps.build.outputs.artifact }}-physics"
# emitted by build.sh, zero or one lines
@@ -382,37 +364,62 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
+ - name: Download viewer exe
+ uses: actions/download-artifact@v4
+ with:
+ name: Windows-app
+ path: _artifacts
+ - name: Download Windows Symbols
+ if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
+ uses: actions/download-artifact@v4
+ with:
+ name: Windows-symbols
+ - name: Extract viewer pdb
+ if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
+ shell: bash
+ run: |
+ tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts
- name: Post Windows symbols
if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
- uses: secondlife/viewer-build-util/post-bugsplat-windows@v2
+ uses: secondlife-3p/symbol-upload@v10
with:
username: ${{ env.BUGSPLAT_USER }}
password: ${{ env.BUGSPLAT_PASS }}
database: "SecondLife_Viewer_2018"
- channel: ${{ needs.build.outputs.viewer_channel }}
+ application: ${{ needs.build.outputs.viewer_channel }}
version: ${{ needs.build.outputs.viewer_version }}
+ directory: _artifacts
+ files: "**/{SecondLifeViewer.exe,llwebrtc.dll,*.pdb}"
post-mac-symbols:
env:
BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }}
BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }}
needs: build
+ if: needs.build.outputs.configuration == 'Release'
runs-on: ubuntu-latest
steps:
+ - name: Download Mac Symbols
+ if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
+ uses: actions/download-artifact@v4
+ with:
+ name: macOS-symbols
- name: Post Mac symbols
if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
- uses: secondlife/viewer-build-util/post-bugsplat-mac@v2
+ uses: secondlife-3p/symbol-upload@v10
with:
username: ${{ env.BUGSPLAT_USER }}
password: ${{ env.BUGSPLAT_PASS }}
database: "SecondLife_Viewer_2018"
- channel: ${{ needs.build.outputs.viewer_channel }}
- version: ${{ needs.build.outputs.viewer_version }}
+ application: ${{ needs.build.outputs.viewer_channel }}
+ version: ${{ needs.build.outputs.viewer_version }} (${{ needs.build.outputs.viewer_version }})
+ directory: .
+ files: "**/*.xcarchive.zip"
release:
- needs: [setvar, build, sign-and-package-windows, sign-and-package-mac]
+ needs: [setup, build, sign-and-package-windows, sign-and-package-mac]
runs-on: ubuntu-latest
- if: needs.setvar.outputs.release_run
+ if: needs.setup.outputs.release_run
steps:
- uses: actions/download-artifact@v4
with:
diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml
index e44e223589..f77151a815 100644
--- a/.github/workflows/stale.yaml
+++ b/.github/workflows/stale.yaml
@@ -1,4 +1,4 @@
-name: Stale PRs
+name: Stale PRs
on:
workflow_dispatch:
schedule:
diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml
new file mode 100644
index 0000000000..65d1d43a83
--- /dev/null
+++ b/.github/workflows/tag-release.yaml
@@ -0,0 +1,47 @@
+name: Tag a Build
+
+on:
+ # schedule event triggers always run on the default branch
+ # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
+ schedule:
+ # run "nightly" builds on default branch every mon/wed/fri
+ - cron: "21 2 * * 2,4,6" # 2:21am UTC tues/thurs/sat == 7:21pm PDT mon/wed/fri -- see https://crontab.guru/#21_01_*_*_2,4,6
+ workflow_dispatch:
+ inputs:
+ channel:
+ description: "Channel to configure the build"
+ required: true
+ type: choice
+ default: "Test"
+ options:
+ - "Test"
+ - "Develop"
+ - "Project"
+ - "Release"
+ project:
+ description: "Project Name (used for channel name in project builds, and tag name for all builds)"
+ default: "hippo"
+ # TODO - add an input for selecting another sha to build other than head of branch
+
+jobs:
+ tag-release:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Setup Env Vars
+ run: |
+ CHANNEL="${{ inputs.channel }}"
+ echo VIEWER_CHANNEL="Second_Life_${CHANNEL:-Develop}" >> ${GITHUB_ENV}
+ NIGHTLY_DATE=$(date --rfc-3339=date)
+ echo NIGHTLY_DATE=${NIGHTLY_DATE} >> ${GITHUB_ENV}
+ echo TAG_ID="$(echo ${{ github.sha }} | cut -c1-8)-${{ inputs.project || '${NIGHTLY_DATE}' }}" >> ${GITHUB_ENV}
+ - name: Update Tag
+ uses: actions/github-script@v7.0.1
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ github.rest.git.createRef({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ ref: "refs/tags/${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}",
+ sha: context.sha
+ })