mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 03:50:16 +02:00
219 lines
8.6 KiB
YAML
219 lines
8.6 KiB
YAML
name: CMake CI
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
|
|
# Eventually we will want to enable CI builds on push to specific branches, but we probably want to configure it not to happen in forks
|
|
# push:
|
|
# branches:
|
|
# - master
|
|
# - stable
|
|
|
|
env:
|
|
APP_NAME: interface
|
|
APP_SYMBOLS_PATH: interface\Release
|
|
BUILD_TYPE: Release
|
|
BUCKET_NAME: hifi-gh-builds
|
|
CI_BUILD: Github
|
|
CMAKE_BACKTRACE_URL: https://highfidelity.sp.backtrace.io:6098
|
|
CMAKE_BACKTRACE_TOKEN: ${{ secrets.backtrace_token }}
|
|
CMAKE_BACKTRACE_SYMBOLS_TOKEN: ${{ secrets.backtrace_symbols_token }}
|
|
GIT_COMMIT: ${{ github.sha }}
|
|
RELEASE_TYPE: PRODUCTION
|
|
RELEASE_NUMBER: ${{ github.event.number }}
|
|
VERSION_CODE: ${{ github.event.number }}
|
|
GIT_PR_COMMIT: ${{ github.sha }}
|
|
HIFI_VCPKG_BOOTSTRAP: true
|
|
OCULUS_APP_ID: '1255907384473836'
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
|
|
|
|
# OSX specific variables
|
|
DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer
|
|
MACOSX_DEPLOYMENT_TARGET: '10.11'
|
|
# WIN32 specific variables
|
|
PreferredToolArchitecture: X64
|
|
|
|
LINUX_DOCKER_IMAGE_NAME: "linux-hifi-gha:${{ github.event.number }}"
|
|
|
|
# Mac OS
|
|
#PLATFORM_CMAKE_GENERATOR=Xcode
|
|
#PLATFORM_BUILD_ARGUMENTS=--config Release --target package
|
|
#ARTIFACT_EXPRESSION=build/*.dmg,build/*.zip
|
|
|
|
# Windows
|
|
#PLATFORM_CMAKE_GENERATOR=Visual Studio 15 2017 Win64
|
|
#PLATFORM_BUILD_ARGUMENTS=--target package --config release
|
|
#ARTIFACT_EXPRESSION=build/*.exe,build/*.zip,*-symbols.zip
|
|
|
|
# Ubuntu
|
|
#PLATFORM_CMAKE_GENERATOR=Unix Makefiles
|
|
#PLATFORM_BUILD_ARGUMENTS=--target all -- -j4
|
|
#ARTIFACT_EXPRESSION=build/assignment-client/**,build/domain-server/**,build/ice-server/ice-server,build/tools/ice-client/ice-client,build/tools/ac-client/ac-client,build/tools/oven,build/ext/makefiles/nvtt/project/lib/**,build/ext/makefiles/quazip/project/lib/**
|
|
|
|
# Android
|
|
#OAUTH_CLIENT_SECRET=${MASKED_ANDROID_OAUTH_CLIENT_SECRET_NIGHTLY}
|
|
#OAUTH_CLIENT_ID=6c7d2349c0614640150db37457a1f75dce98a28ffe8f14d47f6cfae4de5b262a
|
|
#OAUTH_REDIRECT_URI=https://dev-android-interface.highfidelity.com/auth
|
|
#ARTIFACT_EXPRESSION=android/*.apk
|
|
#SHA7=${GIT_PR_COMMIT_SHORT}
|
|
#ANDROID_APK_NAME=HighFidelity-Beta-PR${RELEASE_NUMBER}-${GIT_PR_COMMIT_SHORT}.apk
|
|
#ANDROID_BUILT_APK_NAME=interface-debug.apk
|
|
#ANDROID_APP=interface
|
|
#ANDROID_BUILD_DIR=debug
|
|
#ANDROID_BUILD_TARGET=assembleDebug
|
|
#STABLE_BUILD=0
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, macOS-latest, ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
if: github.event.action != 'labeled' || github.event.label.name == 'rebuild'
|
|
steps:
|
|
- name: Configure Build Environment 1
|
|
shell: bash
|
|
run: |
|
|
echo ::set-env name=UPLOAD_PREFIX::master/$RELEASE_NUMBER
|
|
echo ::set-env name=GIT_COMMIT_SHORT::`echo $GIT_COMMIT | cut -c1-7`
|
|
# Linux build variables
|
|
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
|
|
echo ::set-env name=INSTALLER_EXT::tgz
|
|
fi
|
|
# Mac build variables
|
|
if [ "${{ matrix.os }}" = "macOS-latest" ]; then
|
|
echo ::set-env name=INSTALLER_EXT::dmg
|
|
fi
|
|
# Windows build variables
|
|
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
echo ::set-env name=INSTALLER_EXT::exe
|
|
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: |
|
|
echo ::set-env name=ARTIFACT_PATTERN::HighFidelity-Beta-*.$INSTALLER_EXT
|
|
# Build type variables
|
|
if [ "${{ matrix.build_type }}" = "full" ]; then
|
|
echo ::set-env name=CLIENT_ONLY::FALSE
|
|
echo ::set-env name=INSTALLER::HighFidelity-Beta-$RELEASE_NUMBER-$GIT_COMMIT_SHORT.$INSTALLER_EXT
|
|
else
|
|
echo ::set-env name=CLIENT_ONLY::TRUE
|
|
echo ::set-env name=INSTALLER::HighFidelity-Beta-Interface-$RELEASE_NUMBER-$GIT_COMMIT_SHORT.$INSTALLER_EXT
|
|
fi
|
|
# Linux build variables
|
|
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
|
|
echo ::set-env name=CLIENT_ONLY::FALSE
|
|
echo ::set-env name=PYTHON_EXEC::python3
|
|
echo ::set-env name=CMAKE_EXTRA::-DBUILD_TOOLS:BOOLEAN=FALSE
|
|
fi
|
|
# Mac build variables
|
|
if [ "${{ matrix.os }}" = "macOS-latest" ]; then
|
|
echo ::set-env name=PYTHON_EXEC::python3
|
|
echo ::set-env name=CMAKE_EXTRA::"-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode"
|
|
fi
|
|
# Windows build variables
|
|
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
echo ::set-env name=PYTHON_EXEC::python
|
|
echo ::set-env name=CMAKE_EXTRA::"-A x64"
|
|
echo ::set-env name=HF_PFX_PASSPHRASE::${{secrets.pfx_key}}
|
|
echo "::set-env name=HF_PFX_FILE::${{runner.workspace}}\build\codesign.pfx"
|
|
fi
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 1
|
|
- name: Install apt packages (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: sudo apt install -y mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0
|
|
- name: Install python modules
|
|
shell: bash
|
|
run: |
|
|
if [ "`uname`" == Darwin ]; then
|
|
pip3 install boto3 PyGithub
|
|
else
|
|
pip install boto3 PyGithub
|
|
fi
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{runner.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
working-directory: ${{runner.workspace}}/build
|
|
shell: bash
|
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCLIENT_ONLY:BOOLEAN=$CLIENT_ONLY $CMAKE_EXTRA
|
|
# macOS
|
|
- name: Build Console (macOS)
|
|
if: matrix.os == 'macOS-latest'
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target packaged-server-console
|
|
- name: Build Application (macOS)
|
|
if: matrix.os == 'macOS-latest'
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target $APP_NAME
|
|
- name: Build Domain Server (macOS)
|
|
if: matrix.os == 'macOS-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target domain-server
|
|
- name: Build Assignment Client (macOS)
|
|
if: matrix.os == 'macOS-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target assignment-client
|
|
- name: Build Installer (macOS)
|
|
if: matrix.os == 'macOS-latest'
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target package
|
|
|
|
#build_full_win32:
|
|
|
|
- name: Build Console (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target packaged-server-console
|
|
- name: Build Application (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target $APP_NAME
|
|
- name: Build Domain Server (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target domain-server
|
|
- name: Build Assignment Client (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target assignment-client
|
|
- name: Build Installer (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE --target package
|
|
#build_full_linux:
|
|
|
|
- name: Build (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
# Parallel make:
|
|
run: cmake --build . -- -j3
|
|
- name: Build Ubuntu Docker (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
cp $GITHUB_WORKSPACE/tools/ci-scripts/linux-gha/hifi.conf .
|
|
docker build -t $LINUX_DOCKER_IMAGE_NAME -f $GITHUB_WORKSPACE/tools/ci-scripts/linux-gha/Dockerfile ./
|
|
- name: Export Docker image (Linux)
|
|
if: matrix.os == 'ubuntu-latest' && env.RELEASE_TYPE == 'PRODUCTION'
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: docker save -o ${{runner.workspace}}/build/hifi_docker_image.tar $LINUX_DOCKER_IMAGE_NAME
|
|
|