Merge pull request #10 from AiraYumi/release/maint-b #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build-Custom | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: ["cleanup-linux/*", "build/*", "testing/*"] | |
tags: ["Second_Life_*"] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
runner: [ubuntu-latest] | |
configuration: [ReleaseOS] | |
python-version: ["3.11"] | |
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 }} | |
env: | |
AUTOBUILD_ADDRSIZE: 64 | |
AUTOBUILD_BUILD_ID: ${{ github.run_id }} | |
AUTOBUILD_CONFIGURATION: ${{ matrix.configuration }} | |
# authorizes fetching private constituent packages | |
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. | |
BUGSPLAT_DB: ${{ matrix.configuration != 'ReleaseOS' && 'SecondLife_Viewer_2018' || '' }} | |
build_coverity: false | |
build_log_dir: ${{ github.workspace }}/.logs | |
build_viewer: true | |
BUILDSCRIPTS_SHARED: ${{ github.workspace }}/.shared | |
# extracted and committed to viewer repo | |
BUILDSCRIPTS_SUPPORT_FUNCTIONS: ${{ github.workspace }}/buildscripts_support_functions | |
GIT_REF: ${{ github.head_ref || github.ref }} | |
LL_SKIP_REQUIRE_SYSROOT: 1 | |
# Setting this variable directs Linden's TUT test driver code to capture | |
# test-program log output at the specified level, but to display it only if | |
# the individual test fails. | |
LOGFAIL: DEBUG | |
master_message_template_checkout: ${{ github.workspace }}/.master-message-template | |
# Only set variants to the one configuration: don't let build.sh loop | |
# over variants, let GitHub distribute variants over multiple hosts. | |
variants: ${{ matrix.configuration }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout build variables | |
uses: actions/checkout@v4 | |
with: | |
repository: secondlife/build-variables | |
ref: master | |
path: .build-variables | |
- name: Checkout master-message-template | |
uses: actions/checkout@v4 | |
with: | |
repository: secondlife/master-message-template | |
path: .master-message-template | |
- name: Install autobuild and python dependencies | |
run: pip3 install autobuild llsd | |
- name: Cache autobuild packages | |
uses: actions/cache@v4 | |
id: cache-installables | |
with: | |
path: .autobuild-installables | |
key: ${{ runner.os }}-64-${{ matrix.configuration }}-${{ hashFiles('autobuild.xml') }} | |
restore-keys: | | |
${{ runner.os }}-64-${{ matrix.configuration }}- | |
${{ runner.os }}-64- | |
- name: Install Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install -y \ | |
libsndio-dev libpulse-dev libfltk1.3-dev \ | |
libunwind-dev libgl1-mesa-dev libglu1-mesa-dev \ | |
libx11-dev libxrandr-dev libxinerama-dev \ | |
libxcursor-dev libxi-dev libxext-dev \ | |
libxrender-dev libxfixes-dev libxxf86vm-dev \ | |
libxss-dev libdbus-1-dev libudev-dev \ | |
libssl-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | |
libfreetype6-dev ninja-build libxft-dev \ | |
llvm mold | |
- 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 | |
set -x | |
mkdir -p "$build_log_dir" | |
mkdir -p "$BUILDSCRIPTS_SHARED/packages/lib/python" | |
source "$BUILDSCRIPTS_SUPPORT_FUNCTIONS" | |
if [[ "$OSTYPE" =~ cygwin|msys ]] | |
then | |
native_path() { cygpath --windows "$1"; } | |
shell_path() { cygpath --unix "$1"; } | |
else | |
native_path() { echo "$1"; } | |
shell_path() { echo "$1"; } | |
fi | |
finalize() | |
{ | |
case "$1" in | |
true|0) | |
record_success "Build Succeeded" | |
;; | |
*) | |
record_failure "Build Failed with $1" | |
;; | |
esac | |
} | |
initialize_build() | |
{ | |
echo "initialize_build" | |
} | |
initialize_version() | |
{ | |
export revision="$AUTOBUILD_BUILD_ID" | |
} | |
python_cmd() | |
{ | |
if [[ "x${1:0:1}" == "x-" ]] # -m, -c, etc. | |
then # if $1 is a switch, don't try to twiddle paths | |
"$(shell_path "$PYTHON_COMMAND")" "$@" | |
elif [[ "$(basename "$1")" == "codeticket.py" ]] | |
then # ignore any attempt to contact codeticket | |
echo "## $@" | |
else # running a script at an explicit path: fix path for Python | |
local script="$1" | |
shift | |
"$(shell_path "$PYTHON_COMMAND")" "$(native_path "$script")" "$@" | |
fi | |
} | |
repo_branch() | |
{ | |
echo "$AUTOBUILD_VCS_BRANCH" | |
} | |
record_dependencies_graph() | |
{ | |
echo "TODO: generate and post dependency graph" | |
} | |
# Since we're not uploading to codeticket, DO NOT sleep for minutes. | |
sleep() | |
{ | |
echo "Not sleeping for $1 seconds" | |
} | |
export -f native_path shell_path finalize initialize_build initialize_version | |
export -f python_cmd repo_branch record_dependencies_graph sleep | |
## Useful for diagnosing Windows LLProcess/LLLeap test failures | |
##export APR_LOG="${RUNNER_TEMP}/apr.log" | |
export arch=$(uname | cut -b-6) | |
# Surprise! GH Windows runner's MINGW6 is a $arch value we've never | |
# 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" | |
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. | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
export PYTHON="$(native_path "$(which python)")" | |
echo "Python location: $PYTHON" | |
export PYTHON_COMMAND="$PYTHON" | |
else | |
export PYTHON_COMMAND="python3" | |
fi | |
export PYTHON_COMMAND_NATIVE="$(native_path "$PYTHON_COMMAND")" | |
# Compile with clang, link with mold on linux. | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
export CC=clang | |
export CXX=clang++ | |
export CMAKE_OPTIONS='-DLINK_WITH_MOLD=ON' | |
fi | |
./build.sh | |
# Each artifact is downloaded as a distinct .zip file. Multiple jobs | |
# (per the matrix above) writing the same filepath to the same | |
# artifact name will *overwrite* that file. Moreover, they can | |
# interfere with each other, causing the upload to fail. | |
# https://github.com/actions/upload-artifact#uploading-to-the-same-artifact | |
# Given the size of our installers, and the fact that we typically | |
# only want to download just one instead of a single zip containing | |
# several, generate a distinct artifact name for each installer. | |
# If the matrix above can run multiple builds on the same | |
# platform, we must disambiguate on more than the platform name. | |
# e.g. if we were still running Windows 32-bit builds, we'd need to | |
# qualify the artifact with bit width. | |
if [[ "$AUTOBUILD_CONFIGURATION" == "ReleaseOS" ]] | |
then cfg_suffix='OS' | |
else cfg_suffix='' | |
fi | |
echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT | |
# ND: We only have ReleaseOS builds for Linux so far, thus upload what we have | |
# This steps can be deleted once "Release" is in place and makes "ReleaseOS" obsolete (for upload) | |
- name: Upload Linux ReleaseOS archive | |
if: matrix.configuration == 'ReleaseOS' && steps.build.outputs.viewer_app && runner.os == 'linux' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ steps.build.outputs.artifact }}-app" | |
path: | | |
${{ steps.build.outputs.viewer_app }} |