Skip to content

Merge pull request #1933 from HifiExperiments/materialPicking #149

Merge pull request #1933 from HifiExperiments/materialPicking

Merge pull request #1933 from HifiExperiments/materialPicking #149

Workflow file for this run

# Copyright 2013-2019 High Fidelity, Inc.
# Copyright 2020-2022 Vircadia contributors
# Copyright 2021-2025 Overte e.V.
# SPDX-License-Identifier: Apache-2.0
name: Master CI Build
on:
push:
branches:
- master
env:
BUILD_TYPE: Release
GIT_COMMIT: ${{ github.sha }}
UPLOAD_BUCKET: overte-public
UPLOAD_REGION: fra1
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
CMAKE_BUILD_EXTRA: --preset conan-release
jobs:
build:
name: "${{matrix.os}}, ${{matrix.arch}}"
strategy:
matrix:
include:
- os: Windows 2022
# We use a third-party runner hosted by depot.dev to avoid timing out in case Qt has to be built from source.
runner: depot-windows-2022-16 # Which GitHub Actions Runner to use.
arch: x86_64
build_type: full
qt_source: source # Which Qt Conan package to use. `system`, `source`, or `aqt`.
#- os: macOS 10.15
# runner: macOS-10.15
# build_type: full
# qt_source: source
- os: Ubuntu 22.04
image: docker.io/overte/overte-full-build:2026-01-01-ubuntu-22.04-amd64 # Container image used for building. Built from /tools/ci-script/linux-ci/Dockerfile_x
runner: ubuntu-latest
arch: amd64
build_type: full
qt_source: system
- os: Ubuntu 22.04
image: docker.io/overte/overte-full-build:2026-01-01-ubuntu-22.04-aarch64
runner: ubuntu-24.04-arm
arch: aarch64
build_type: full
qt_source: system
fail-fast: false
runs-on: ${{matrix.runner}}
container: ${{matrix.image}}
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: Prepare Windows environment
if: startsWith(matrix.os, 'Windows')
uses: ./.github/actions/setup-windows
- name: Read image environment variables
# Bring some environment variables out of the Runner (Docker) image's environment into the Job environment.
if: ${{matrix.image}} != ""
shell: bash
run: |
echo "CONAN_HOME=$CONAN_HOME" >> $GITHUB_ENV
echo "CONAN_PROFILE=$CONAN_PROFILE" >> $GITHUB_ENV
echo "APP_TARGET_NAME=$APP_TARGET_NAME" >> $GITHUB_ENV
- name: Configure build environment 1
shell: bash
id: buildenv1
run: |
echo "UPLOAD_PREFIX=build/overte/master" >> $GITHUB_ENV
# Setting short commit SHA for use as RELEASE_NAME in generated installers.
echo "GIT_COMMIT_SHORT=`echo $GIT_COMMIT | cut -c1-7`" >> $GITHUB_ENV
echo "JOB_NAME=build (${{matrix.os}}, ${{matrix.build_type}})" >> $GITHUB_ENV
# Linux build variables
if [[ "${{ matrix.os }}" =~ "Ubuntu" ]]; then
echo "CONAN_CPPSTD=gnu20" >> $GITHUB_ENV
echo "INSTALLER_EXT=AppImage" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE" >> $GITHUB_ENV
fi
# Mac build variables
if [[ "${{ matrix.os }}" =~ "macOS" ]]; then
echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV
fi
# Windows build variables
if [[ "${{ matrix.os }}" =~ "Windows" ]]; then
echo "CONAN_CPPSTD=20" >> $GITHUB_ENV
echo "INSTALLER_EXT=exe" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DJSDOC_ENABLED:BOOL=TRUE" >> $GITHUB_ENV
# echo "HF_PFX_PASSPHRASE=${{secrets.pfx_key}}" >> $GITHUB_ENV
# echo "HF_PFX_FILE=${{runner.workspace}}\build\codesign.pfx" >> $GITHUB_ENV
fi
# Configuration is broken into two steps because you can't set an env var and also reference it in the same step
- name: Configure build environment 2
shell: bash
run: |
if [[ "${{ matrix.os }}" = "Ubuntu"* ]]; then
echo "ARTIFACT_NAME=Overte-Nightly-${GIT_COMMIT_SHORT}-$(uname -m).$INSTALLER_EXT" >> $GITHUB_ENV
else
echo "ARTIFACT_NAME=Overte-Nightly-${GIT_COMMIT_SHORT}.$INSTALLER_EXT" >> $GITHUB_ENV
fi
echo "${{ steps.buildenv1.outputs.symbols_archive }}"
echo "ARTIFACT_PATTERN=Overte-*.$INSTALLER_EXT" >> $GITHUB_ENV
# Build type variables
if [ "${{ matrix.build_type }}" = "full" ]; then
echo "INSTALLER=Overte-${{ github.event.number }}_${{ github.sha }}-${{ steps.buildenv1.outputs.github_sha_short }}.$INSTALLER_EXT" >> $GITHUB_ENV
else
echo "INSTALLER=Overte-Interface-master-${{ steps.buildenv1.outputs.github_sha_short }}.$INSTALLER_EXT" >> $GITHUB_ENV
fi
- name: Cache conan
uses: actions/cache@v5
with:
key: conan-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('conanfile.py') }}
path: |
${{ env.CONAN_HOME }}/sources
${{ env.CONAN_HOME }}/p
- name: Install Conan dependencies
uses: ./.github/actions/conan-install
with:
qt_source: ${{matrix.qt_source}}
build_type: ${{env.BUILD_TYPE}}
cppstd: ${{env.CONAN_CPPSTD}}
conan_profile: ${{env.CONAN_PROFILE}}
- name: Upload dependency source backups
shell: bash
env:
# Token for uploading dependency source backups.
CONAN_BUILD_DEPENDENCIES_BACKUP_UPLOAD_TOKEN: ${{ secrets.CONAN_BUILD_DEPENDENCIES_BACKUP_UPLOAD_TOKEN }}
run: conan cache backup-upload
- name: Upload Conan binary cache to Artifactory
# Conan isn't glibc aware, so we need to be really careful what we upload to the binary cache on Linux.
# Namely, we should never upload anything from a Linux system that is newer than our oldest Linux target.
# See the upstream discussion: https://github.com/conan-io/conan/issues/7121
if: startsWith(matrix.os, 'Windows') || startsWith(matrix.os, 'macOS') || startsWith(matrix.os, 'Ubuntu 22.04')
continue-on-error: true
uses: ./.github/actions/conan-upload-binaries
with:
CONAN_LOGIN_USERNAME_OVERTE: ${{ secrets.conan_login_username_overte }}
CONAN_PASSWORD_OVERTE: ${{ secrets.conan_password_overte }}
- name: Cleanup Conan dependencies
if: always() && steps.conan-cache.cache-hit != 'true'
run: conan cache clean "*" -sbd
shell: bash
- name: Save Conan cache
if: always() && steps.conan-cache.cache-hit != 'true'
uses: actions/cache/save@v5
with:
key: conan-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('conanfile.py') }}
path: |
${{ env.CONAN_HOME }}/sources
${{ env.CONAN_HOME }}/p
- name: Configure CMake
shell: bash
run: |
if [[ "${{ matrix.os }}" =~ "Windows" ]]; then
# This syntax requires CMake 3.23
cmake --preset conan-default -DOVERTE_GIT_COMMIT_SHORT=$GIT_COMMIT_SHORT -DOVERTE_RELEASE_TYPE=NIGHTLY $CMAKE_EXTRA
else
# This syntax requires CMake 3.23
cmake --preset conan-${BUILD_TYPE,,} -DOVERTE_GIT_COMMIT_SHORT=$GIT_COMMIT_SHORT -DOVERTE_RELEASE_TYPE=NIGHTLY $CMAKE_EXTRA
fi
- name: Build application
shell: bash
run: cmake --build . --target $APP_TARGET_NAME $CMAKE_BUILD_EXTRA
- name: Build domain server
shell: bash
run: cmake --build . --target domain-server $CMAKE_BUILD_EXTRA
- name: Build assignment client
shell: bash
run: cmake --build . --target assignment-client $CMAKE_BUILD_EXTRA
- name: Build console
shell: bash
run: cmake --build . --target packaged-server-console $CMAKE_BUILD_EXTRA
- name: Build installer
shell: bash
run: |
echo "Retry code from https://unix.stackexchange.com/a/137639"
function fail {
echo $1 >&2
exit 1
}
function retry {
local n=1
local max=5
local delay=15
while true; do
"$@" && break || {
if [[ $n -lt $max ]]; then
((n++))
echo "Command failed. Attempt $n/$max:"
sleep $delay;
else
fail "The command has failed after $n attempts."
fi
}
done
}
retry cmake --build . --config $BUILD_TYPE --target package $CMAKE_BUILD_EXTRA
#- name: Sign installer (Windows)
# if: startsWith(matrix.os, 'windows')
# shell: powershell
# working-directory: C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64
# run: .\signtool.exe sign /fd sha256 /f ${{runner.workspace}}\build\codesign.pfx /p ${{secrets.pfx_key}} /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 ${{runner.workspace}}\build\${env:INSTALLER}
- name: Upload artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/Overte-*
if-no-files-found: error
- name: Output debug information
if: always()
uses: ./.github/actions/debug-info