From f39088fb0b72313a614e614660e5e97f6bb8cb90 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 2 Dec 2019 15:33:15 -0800 Subject: [PATCH] Github Actions master builds --- .github/workflows/cmake.yml | 197 ----------------- .github/workflows/dump.yml | 46 ++++ .github/workflows/master_build.yml | 252 ++++++++++++++++++++++ .github/workflows/pr_build.yml | 88 ++++++++ CMakeLists.txt | 7 + android/containerized_build.sh | 2 +- cmake/macros/SetPackagingParameters.cmake | 6 +- hifi_vcpkg.py | 5 +- tools/ci-scripts/codesign.pfx.gpg | Bin 0 -> 3188 bytes tools/ci-scripts/postbuild.py | 10 +- tools/ci-scripts/pr_comment.py | 24 +++ tools/ci-scripts/upload.py | 9 +- tools/gpu-frame-player/CMakeLists.txt | 14 ++ 13 files changed, 444 insertions(+), 216 deletions(-) delete mode 100644 .github/workflows/cmake.yml create mode 100644 .github/workflows/dump.yml create mode 100644 .github/workflows/master_build.yml create mode 100644 .github/workflows/pr_build.yml create mode 100644 tools/ci-scripts/codesign.pfx.gpg create mode 100644 tools/ci-scripts/pr_comment.py diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index 36cab7a929..0000000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,197 +0,0 @@ -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: - CI_BUILD: Github - BUILD_TYPE: Release - RELEASE_TYPE: PR - RELEASE_NUMBER: ${{ github.event.number }} - VERSION_CODE: ${{ github.event.number }} - GIT_PR_COMMIT: ${{ github.sha }} - # FIXME should be a shortened version of the SHA - GIT_PR_COMMIT_SHORT: ${{ github.sha }} - HIFI_VCPKG_BOOTSTRAP: true - - AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} - - # Settings for uploading - APP_NAME: interface - #APP_NAME: gpu-frame-player - BUCKET_NAME: hifi-public - UPLOAD_PREFIX: austin/builds - - # OSX specific variables - DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer - MACOSX_DEPLOYMENT_TARGET: '10.11' - # WIN32 specific variables - PreferredToolArchitecture: X64 - - BS_USERNAME: gustavo@highfidelity.io - BS_PASSWORD: ${MASKED_BUGSPLAT_PASSWORD} - CMAKE_BACKTRACE_URL: https://highfidelity.sp.backtrace.io:6098 - GA_TRACKING_ID: UA-39558647-8 - OCULUS_APP_ID: '1255907384473836' - # CMAKE_BACKTRACE_TOKEN: ${MASKED_CMAKE_BACKTRACE_TOKEN} - # CMAKE_BACKTRACE_SYMBOLS_TOKEN: ${MASKED_BACKTRACE_UPLOAD_TOKEN} - -# 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_client_mac: - runs-on: macOS-latest - if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-mac' || github.event.label.name == 'rebuild' - steps: - - uses: actions/checkout@v1 - with: - submodules: true - fetch-depth: 1 - - name: Install python modules - run: pip3 install awscli boto3 PyGithub - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure CMake - working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DCLIENT_ONLY:BOOLEAN=TRUE -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode -DVCPKG_APPLOCAL_DEPS=OFF - - name: Build Console - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target packaged-server-console - - name: Build Application - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target $APP_NAME - - name: Build Installer - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target package - - build_full_mac: - runs-on: macOS-latest - if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-mac' || github.event.label.name == 'rebuild' - steps: - - uses: actions/checkout@v1 - with: - submodules: true - fetch-depth: 1 - - name: Install python modules - run: pip3 install awscli boto3 PyGithub - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure CMake - working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode -DVCPKG_APPLOCAL_DEPS=OFF - - name: Build Console - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target packaged-server-console - - name: Build Application - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target $APP_NAME - - name: Build Domain Server - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target domain-server - - name: Build Assignment Client - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target assignment-client - - name: Build Installer - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target package - - build_client_win32: - runs-on: windows-latest - if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-win' || github.event.label.name == 'rebuild' - steps: - - uses: actions/checkout@v1 - with: - submodules: true - fetch-depth: 1 - - name: Install python modules - run: pip install awscli boto3 PyGithub - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure CMake - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCLIENT_ONLY:BOOLEAN=TRUE -A x64 - - name: Build Console - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target packaged-server-console - - name: Build Application - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target $APP_NAME - - name: Build Installer - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target package - - build_full_win32: - runs-on: windows-latest - if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-win' || github.event.label.name == 'rebuild' - steps: - - uses: actions/checkout@v1 - with: - submodules: true - fetch-depth: 1 - - name: Install python modules - run: pip install awscli boto3 PyGithub - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure CMake - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -A x64 - - name: Build Console - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target packaged-server-console - - name: Build Application - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target $APP_NAME - - name: Build Domain Server - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target domain-server - - name: Build Assignment Client - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target assignment-client - - name: Build Installer - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config $BUILD_TYPE --target package diff --git a/.github/workflows/dump.yml b/.github/workflows/dump.yml new file mode 100644 index 0000000000..279d8ff2f8 --- /dev/null +++ b/.github/workflows/dump.yml @@ -0,0 +1,46 @@ +name: Dump Contexts + +on: + push: + branches: + - master + + +jobs: + one: + strategy: + matrix: + os: [windows-latest, macOS-latest] + + runs-on: ${{ matrix.os }} + steps: + - name: Dump GitHub context + shell: bash + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump job context + shell: bash + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + - name: Dump steps context + shell: bash + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Dump runner context + shell: bash + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + - name: Dump strategy context + shell: bash + env: + STRATEGY_CONTEXT: ${{ toJson(strategy) }} + run: echo "$STRATEGY_CONTEXT" + - name: Dump matrix context + shell: bash + env: + MATRIX_CONTEXT: ${{ toJson(matrix) }} + run: echo "$MATRIX_CONTEXT" \ No newline at end of file diff --git a/.github/workflows/master_build.yml b/.github/workflows/master_build.yml new file mode 100644 index 0000000000..4592f8882a --- /dev/null +++ b/.github/workflows/master_build.yml @@ -0,0 +1,252 @@ +name: Master CI Build + +on: + push: + branches: + - master + +env: + #APP_NAME: gpu-frame-player + APP_NAME: interface + 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 }} + HIFI_VCPKG_BOOTSTRAP: true + LAUNCHER_HMAC_SECRET: ${{ secrets.launcher_hmac_secret }} + OCULUS_APP_ID: '${{ secrets.oculus_app_id }}' + RELEASE_TYPE: PRODUCTION + RELEASE_DYNAMODB_V2: ReleaseManager2-ReleaseQueue-prod + STABLE_BUILD: 0 + + + # OSX specific variables + DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer + MACOSX_DEPLOYMENT_TARGET: '10.11' + + # WIN32 specific variables + PreferredToolArchitecture: X64 + +# 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 +# branch: master +# GA_TRACKING_ID: ${{ secrets.ga_tracking_id }} +# ANDROID_OAUTH_CLIENT_SECRET=${MASKED_ANDROID_OAUTH_CLIENT_SECRET_NIGHTLY} +# ANDROID_OAUTH_CLIENT_ID=6c7d2349c0614640150db37457a1f75dce98a28ffe8f14d47f6cfae4de5b262a +# ANDROID_OAUTH_REDIRECT_URI=https://dev-android-interface.highfidelity.com/auth +# branch: !master +# GA_TRACKING_ID=UA-39558647-11 +# ANDROID_OAUTH_CLIENT_SECRET=${MASKED_ANDROID_OAUTH_CLIENT_SECRET_RELEASE} +# ANDROID_OAUTH_CLIENT_ID= c1063ea5d0b0c405e0c9cd77351328e211a91496a3f25985a99e861f1661db1d +# ANDROID_OAUTH_REDIRECT_URI=https://android-interface.highfidelity.com/auth +# ARTIFACT_EXPRESSION=android/*.apk +# ANDROID_APK_NAME=HighFidelity-Beta-PR${RELEASE_NUMBER}-${GIT_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: + generate_build_number: + runs-on: ubuntu-latest + steps: + - name: Generate build number + id: buildnumber + uses: jherico/build-number@v3 + with: + token: ${{secrets.github_token}} + - name: Upload build number + uses: actions/upload-artifact@v1 + with: + name: BUILD_NUMBER + path: BUILD_NUMBER + + build: + strategy: + matrix: + os: [windows-latest, macOS-latest] + build_type: [full, client] + #os: [windows-latest, macOS-latest, ubuntu-latest] + # exclude: + # - os: ubuntu-latest + # build_type: client + runs-on: ${{matrix.os}} + if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-mac' || github.event.label.name == 'rebuild' + needs: generate_build_number + steps: + - name: Download build number + uses: actions/download-artifact@v1 + with: + name: BUILD_NUMBER + - name: Restore build number + id: buildnumber + uses: jherico/build-number@v3 + with: + output_name: RELEASE_NUMBER + - name: Configure Build Environment 1 + shell: bash + id: buildenv1 + 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=PYTHON_EXEC::python3 + echo ::set-env name=ZIP_COMMAND::zip + echo ::set-env name=ZIP_ARGS::-r + echo ::set-env name=INSTALLER_EXT::dmg + echo ::set-env name=SYMBOL_REGEX::dSYM + echo "::set-output name=symbols_archive::${{ steps.buildnumber.outputs.build_number }}-${{ matrix.build_type }}-mac-symbols.zip" + fi + # Windows build variables + if [ "${{ matrix.os }}" = "windows-latest" ]; then + echo ::set-env name=PYTHON_EXEC::python + echo ::set-env name=ZIP_COMMAND::7z + echo ::set-env name=ZIP_ARGS::a + echo ::set-env name=INSTALLER_EXT::exe + echo "::set-env name=SYMBOL_REGEX::\(exe\|dll\|pdb\)" + echo "::set-output name=symbols_archive::${{ steps.buildnumber.outputs.build_number }}-${{ matrix.build_type }}-win-symbols.zip" + fi + # Configureation 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 "${{ steps.buildenv1.outputs.symbols_archive }}" + 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=PYTHON_EXEC::python3 + echo ::set-env name=CMAKE_EXTRA::"" + fi + # Mac build variables + if [ "${{ matrix.os }}" = "macOS-latest" ]; then + 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=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 + - uses: actions/checkout@v1 + with: + submodules: true + fetch-depth: 1 + - name: Create Build Directory + run: cmake -E make_directory ${{runner.workspace}}/build + - name: Decrypt Signing Key (Windows) + if: matrix.os == 'windows-latest' + working-directory: ${{runner.workspace}}/build + shell: bash + run: gpg --batch --yes -o codesign.pfx --passphrase "${{secrets.gpg_symmetric_key}}" --decrypt $GITHUB_WORKSPACE/tools/ci-scripts/codesign.pfx.gpg + - name: Import Signing Key (Windows) + if: matrix.os == 'windows-latest' + working-directory: ${{runner.workspace}}/build + shell: powershell + run: | + $mypwd=ConvertTo-SecureString -String ${{ secrets.pfx_key }} -Force -AsPlainText + Import-PfxCertificate -Password $mypwd -CertStoreLocation Cert:\CurrentUser\My -FilePath ${{runner.workspace}}\build\codesign.pfx + Import-PfxCertificate -Password $mypwd -CertStoreLocation Cert:\LocalMachine\My -FilePath ${{runner.workspace}}\build\codesign.pfx + - name: Install Python modules + if: matrix.os != 'ubuntu-latest' + shell: bash + run: $PYTHON_EXEC -m pip install boto3 PyGithub + - 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 + - name: Build Application + working-directory: ${{runner.workspace}}/build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target $APP_NAME + - name: Build Console + working-directory: ${{runner.workspace}}/build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target packaged-server-console + - name: Build Domain Server (FullBuild) + if: matrix.build_type == 'full' + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target domain-server + - name: Build Assignment Client (FullBuild) + if: matrix.build_type == 'full' + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target assignment-client + - name: Build Installer + working-directory: ${{runner.workspace}}/build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target package + - name: Sign Installer (Windows) + if: matrix.os == 'windows-latest' + 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 + if: matrix.os != 'ubuntu-latest' + shell: bash + working-directory: ${{runner.workspace}}/build + env: + AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + run: $PYTHON_EXEC $GITHUB_WORKSPACE/tools/ci-scripts/upload.py + - name: Archive Symbols + if: (matrix.os == 'windows-latest') || (matrix.os == 'macOS-latest') + working-directory: ${{runner.workspace}} + shell: bash + run: | + SYMBOLS_TEMP="symbols-temp" + mkdir $SYMBOLS_TEMP + find "${{runner.workspace}}/build" \( -path '*/tools/gpu-frame-player/*' -or -path '*/interface/*' -or -path '*/plugins/*' \) -regex ".*\.$SYMBOL_REGEX" -exec cp -r {} $SYMBOLS_TEMP \; + cd $SYMBOLS_TEMP + $ZIP_COMMAND $ZIP_ARGS ../${{ steps.buildenv1.outputs.symbols_archive }} . + - name: Upload Symbols + if: (matrix.os == 'windows-latest') || (matrix.os == 'macOS-latest') + working-directory: ${{runner.workspace}} + shell: bash + run: | + curl --data-binary @${{ steps.buildenv1.outputs.symbols_archive }} "$CMAKE_BACKTRACE_URL/post?format=symbols&token=$CMAKE_BACKTRACE_SYMBOLS_TOKEN&upload_file=${{steps.buildenv1.outputs.symbols_archive}}&tag=$RELEASE_NUMBER" + # - name: Debug List Symbols + # if: (matrix.os == 'windows-latest') || (matrix.os == 'macOS-latest') + # working-directory: ${{runner.workspace}} + # shell: bash + # run: | + # unzip -v "${{runner.workspace}}/${{ steps.buildenv1.outputs.symbols_archive }}" + # - name: Debug Upload Symbols Artifact + # if: (matrix.os == 'windows-latest') || (matrix.os == 'macOS-latest') + # uses: actions/upload-artifact@v1 + # with: + # name: symbols + # path: ${{runner.workspace}}/${{ steps.buildenv1.outputs.symbols_archive }} diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml new file mode 100644 index 0000000000..095364dd7e --- /dev/null +++ b/.github/workflows/pr_build.yml @@ -0,0 +1,88 @@ +name: Pull Request CI Build + +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + +env: + APP_NAME: interface + BUILD_TYPE: Release + CI_BUILD: Github + GIT_COMMIT: ${{ github.sha }} + GIT_COMMIT_SHORT: ${{ github.sha }} + HIFI_VCPKG_BOOTSTRAP: true + RELEASE_TYPE: PR + RELEASE_NUMBER: ${{ github.event.number }} + VERSION_CODE: ${{ github.event.number }} + + # OSX specific variables + DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer + MACOSX_DEPLOYMENT_TARGET: '10.11' + + # WIN32 specific variables + PreferredToolArchitecture: X64 + +jobs: + build_full_mac: + runs-on: macOS-latest + if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-mac' || github.event.label.name == 'rebuild' + steps: + - uses: actions/checkout@v1 + with: + submodules: true + fetch-depth: 1 + - name: Create Build Environment + run: cmake -E make_directory ${{runner.workspace}}/build + - name: Configure CMake + working-directory: ${{runner.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode -DVCPKG_APPLOCAL_DEPS=OFF + - name: Build Console + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target packaged-server-console + - name: Build Application + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target $APP_NAME + - name: Build Domain Server + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target domain-server + - name: Build Assignment Client + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target assignment-client + - name: Build Installer + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target package + + build_full_win32: + runs-on: windows-latest + if: github.event.action != 'labeled' || github.event.label.name == 'rebuild-win' || github.event.label.name == 'rebuild' + steps: + - uses: actions/checkout@v1 + with: + submodules: true + fetch-depth: 1 + - name: Create Build Environment + run: cmake -E make_directory ${{runner.workspace}}/build + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -A x64 + - name: Build Console + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target packaged-server-console + - name: Build Application + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target $APP_NAME + - name: Build Domain Server + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target domain-server + - name: Build Assignment Client + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target assignment-client + - name: Build Installer + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config $BUILD_TYPE --target package diff --git a/CMakeLists.txt b/CMakeLists.txt index a651146dfc..059bcf98d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,6 +257,11 @@ if (ANDROID) return() endif() +if (BUILD_GPU_FRAME_PLAYER_ONLY) + # This is for CI build testing + add_subdirectory(tools/gpu-frame-player) +else() + # add subdirectories for all targets if (BUILD_SERVER) add_subdirectory(assignment-client) @@ -283,6 +288,8 @@ endif() # BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway add_subdirectory(tools) +endif() + if (BUILD_TESTS) # Turn on testing so that add_test works # MUST be in the root cmake file for ctest to work diff --git a/android/containerized_build.sh b/android/containerized_build.sh index 37be6f8be3..0c21d1df91 100755 --- a/android/containerized_build.sh +++ b/android/containerized_build.sh @@ -29,7 +29,7 @@ docker run \ -e CMAKE_BACKTRACE_TOKEN \ -e CMAKE_BACKTRACE_SYMBOLS_TOKEN \ -e GA_TRACKING_ID \ - -e GIT_PR_COMMIT \ + -e GIT_COMMIT \ -e OAUTH_CLIENT_SECRET \ -e OAUTH_CLIENT_ID \ -e OAUTH_REDIRECT_URI \ diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 78f52aed98..cbc89d7724 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -91,13 +91,11 @@ macro(SET_PACKAGING_PARAMETERS) endif () if ((PRODUCTION_BUILD OR PR_BUILD) AND NOT STABLE_BUILD) - set(GIT_PR_COMMIT $ENV{GIT_PR_COMMIT}) - #set(GIT_COMMIT_HASH ${GIT_PR_COMMIT}) - string(SUBSTRING ${GIT_PR_COMMIT} 0 7 GIT_COMMIT_HASH) + set(GIT_COMMIT_SHORT $ENV{GIT_COMMIT_SHORT}) # append the abbreviated commit SHA to the build version # since this is a PR build or master/nightly builds set(BUILD_VERSION_NO_SHA ${BUILD_VERSION}) - set(BUILD_VERSION "${BUILD_VERSION}-${GIT_COMMIT_HASH}") + set(BUILD_VERSION "${BUILD_VERSION}-${GIT_COMMIT_SHORT}") # pass along a release number without the SHA in case somebody # wants to compare master or PR builds as integers diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 9578f56e0d..34c1b13563 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -75,6 +75,7 @@ endif() self.bootstrapEnv = os.environ.copy() self.buildEnv = os.environ.copy() self.prebuiltArchive = None + usePrebuilt = ('CI_BUILD' in os.environ) and os.environ["CI_BUILD"] == "Github" and (not self.noClean) if 'Windows' == system: self.exe = os.path.join(self.path, 'vcpkg.exe') @@ -82,7 +83,7 @@ endif() self.vcpkgUrl = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/builds/vcpkg-win32-client.zip?versionId=tSFzbw01VkkVFeRQ6YuAY4dro2HxJR9U' self.vcpkgHash = 'a650db47a63ccdc9904b68ddd16af74772e7e78170b513ea8de5a3b47d032751a3b73dcc7526d88bcb500753ea3dd9880639ca842bb176e2bddb1710f9a58cd3' self.hostTriplet = 'x64-windows' - if ('CI_BUILD' in os.environ) and os.environ["CI_BUILD"] == "Github" and (not self.noClean): + if usePrebuilt: self.prebuiltArchive = "https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/builds/vcpkg-win32.zip?versionId=3SF3mDC8dkQH1JP041m88xnYmWNzZflx" elif 'Darwin' == system: self.exe = os.path.join(self.path, 'vcpkg') @@ -90,7 +91,7 @@ endif() self.vcpkgUrl = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/builds/vcpkg-osx-client.tgz?versionId=j0b4azo_zTlH_Q9DElEWOz1UMYZ2nqQw' self.vcpkgHash = '519d666d02ef22b87c793f016ca412e70f92e1d55953c8f9bd4ee40f6d9f78c1df01a6ee293907718f3bbf24075cc35492fb216326dfc50712a95858e9cbcb4d' self.hostTriplet = 'x64-osx' - if ('CI_BUILD' in os.environ) and os.environ["CI_BUILD"] == "Github" and (not self.noClean): + if usePrebuilt: self.prebuiltArchive = "https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/builds/vcpkg-osx.tgz?versionId=6JrIMTdvpBF3MAsjA92BMkO79Psjzs6Z" else: self.exe = os.path.join(self.path, 'vcpkg') diff --git a/tools/ci-scripts/codesign.pfx.gpg b/tools/ci-scripts/codesign.pfx.gpg new file mode 100644 index 0000000000000000000000000000000000000000..826465316f727b6049ebcc3683646fc0a43be2a0 GIT binary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