diff --git a/.github/workflows/master_build.yml b/.github/workflows/master_build.yml index 8d9844e03c..2a29624179 100644 --- a/.github/workflows/master_build.yml +++ b/.github/workflows/master_build.yml @@ -1,6 +1,6 @@ name: Master CI Build -on: +on: push: branches: - master @@ -20,7 +20,7 @@ env: # OSX-specific variables DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer - MACOSX_DEPLOYMENT_TARGET: '10.11' + MACOSX_DEPLOYMENT_TARGET: '10.12' # WIN-specific variables PreferredToolArchitecture: X64 @@ -64,7 +64,7 @@ jobs: echo "ZIP_COMMAND=zip" >> $GITHUB_ENV echo "ZIP_ARGS=-r" >> $GITHUB_ENV echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV - echo "CMAKE_EXTRA=-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 + 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 echo "::set-output name=symbols_archive::${BUILD_NUMBER}-${{ matrix.build_type }}-mac-symbols.zip" echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV fi @@ -104,43 +104,68 @@ jobs: with: submodules: false fetch-depth: 1 + - name: Install dependencies - if: startsWith(matrix.os, 'ubuntu') shell: bash + if: startsWith(matrix.os, 'ubuntu') || contains(matrix.os, 'debian') || startsWith(matrix.os, 'macOS') run: | - echo "Installing Python Modules:" - pip3 install distro || exit 1 - echo "Updating apt repository index" - sudo apt update || exit 1 - echo "Installing apt packages" - sudo apt install -y ${{ matrix.apt-dependencies }} || exit 1 + if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then + echo "Installing Python Modules:" + pip3 install distro || exit 1 + + echo "Updating apt repository index" + sudo apt update || exit 1 + + echo "Installing apt packages" + sudo apt install -y ${{ matrix.apt-dependencies }} || exit 1 + else # macOS + echo "Downloading MacOSX10.12 SDK.." + curl --progress-bar -L -O https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.12.sdk.tar.xz || exit 1 + echo " done\n" + echo "Extracting MacOSX10.12 SDK.." + tar -xf MacOSX10.12.sdk.tar.xz || exit 1 + echo " done\n" + echo "Installing MacOSX10.12 SDK.." + # cp always sets an error code while copying the SDK so we return 0 when that happens. + sudo cp -rp MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ || exit 0 + echo " done" + fi + + - name: Install Python modules if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'macOS') shell: bash run: $PYTHON_EXEC -m pip install boto3 PyGithub + - name: Create build environment shell: bash 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 -DVCPKG_BUILD_TYPE=release -DCLIENT_ONLY:BOOLEAN=$CLIENT_ONLY -DBYPASS_SIGNING:BOOLEAN=TRUE $CMAKE_EXTRA + - name: Build application working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target $APP_TARGET_NAME $CMAKE_BUILD_EXTRA + - name: Build domain server working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target domain-server $CMAKE_BUILD_EXTRA + - name: Build assignment client working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target assignment-client $CMAKE_BUILD_EXTRA + - name: Build console working-directory: ${{runner.workspace}}/build shell: bash run: cmake --build . --config $BUILD_TYPE --target packaged-server-console $CMAKE_BUILD_EXTRA + - name: Build installer working-directory: ${{runner.workspace}}/build shell: bash @@ -167,11 +192,13 @@ jobs: 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: Output system stats if: ${{ always() }} working-directory: ${{runner.workspace}}/build @@ -179,19 +206,22 @@ jobs: run: | echo "Disk usage:" df -h + - name: Output installer logs if: failure() && startsWith(matrix.os, 'windows') shell: bash working-directory: ${{runner.workspace}}/build run: cat ./_CPack_Packages/win64/NSIS/NSISOutput.log + - name: Upload artifact if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'macOS') shell: bash - working-directory: ${{runner.workspace}}/build - env: + 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 + AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + run: $PYTHON_EXEC $GITHUB_WORKSPACE/tools/ci-scripts/upload.py + #- name: Archive symbols # if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'macOS') # working-directory: ${{runner.workspace}} diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 9bd3f7fb12..d3c1054a7a 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -20,7 +20,7 @@ env: # OSX specific variables DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer - MACOSX_DEPLOYMENT_TARGET: '10.11' + MACOSX_DEPLOYMENT_TARGET: '10.12' # WIN32 specific variables PreferredToolArchitecture: X64 @@ -85,9 +85,9 @@ jobs: echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV if [ "${{ matrix.build_type }}" = "full" ]; then - echo "CMAKE_EXTRA=-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 + 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 else - echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -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 + echo "CMAKE_EXTRA=-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -DCLIENT_ONLY=1 -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 echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV fi @@ -139,16 +139,29 @@ jobs: - name: Install dependencies shell: bash - if: startsWith(matrix.os, 'ubuntu') || contains(matrix.os, 'debian') + if: startsWith(matrix.os, 'ubuntu') || contains(matrix.os, 'debian') || startsWith(matrix.os, 'macOS') run: | - echo "Installing Python Modules:" - pip3 install distro || exit 1 + if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then + echo "Installing Python Modules:" + pip3 install distro || exit 1 - echo "Updating apt repository index" - sudo apt update || exit 1 + echo "Updating apt repository index" + sudo apt update || exit 1 - echo "Installing apt packages" - sudo apt install -y ${{ matrix.apt-dependencies }} || exit 1 + echo "Installing apt packages" + sudo apt install -y ${{ matrix.apt-dependencies }} || exit 1 + else # macOS + echo "Downloading MacOSX10.12 SDK.." + curl --progress-bar -L -O https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.12.sdk.tar.xz || exit 1 + echo " done\n" + echo "Extracting MacOSX10.12 SDK.." + tar -xf MacOSX10.12.sdk.tar.xz || exit 1 + echo " done\n" + echo "Installing MacOSX10.12 SDK.." + # cp always sets an error code while copying the SDK so we return 0 when that happens. + sudo cp -rp MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ || exit 0 + echo " done" + fi - name: Create Build Environment shell: bash