From b720d17a977d4d090926ddbb6b6e6e81cb44d37e Mon Sep 17 00:00:00 2001 From: jcrm1 <52137472+jcrm1@users.noreply.github.com> Date: Fri, 23 Sep 2022 05:17:50 -0400 Subject: [PATCH] CI: Add macOS x64 to build check and releases (#274) --- .github/workflows/build.yml | 67 +++++++++++++++++++ .../workflows/deploy_experimental_release.yml | 16 ++++- .github/workflows/deploy_stable_release.yml | 16 ++++- 3 files changed, 97 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f97765d0..ef9eb1a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,3 +162,70 @@ jobs: with: name: cemu-bin-windows-x64 path: ./bin/Cemu.exe + build-macos: + runs-on: macos-12 + steps: + - name: "Checkout repo" + uses: actions/checkout@v3 + with: + submodules: "recursive" + - name: Setup release mode parameters (for deploy) + if: ${{ inputs.deploymode == 'release' }} + run: | + echo "BUILD_MODE=release" >> $GITHUB_ENV + echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" >> $GITHUB_ENV + echo "Build mode is release" + - name: Setup debug mode parameters (for continous build) + if: ${{ inputs.deploymode != 'release' }} + run: | + echo "BUILD_MODE=debug" >> $GITHUB_ENV + echo "BUILD_FLAGS=" >> $GITHUB_ENV + echo "Build mode is debug" + + - name: Setup version for experimental + if: ${{ inputs.experimentalversion != '' }} + run: | + echo "[INFO] Experimental version ${{ inputs.experimentalversion }}" + echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV + + - name: "Install system dependencies" + run: | + brew install llvm@14 ninja nasm molten-vk + - name: "Bootstrap vcpkg" + run: | + bash ./dependencies/vcpkg/bootstrap-vcpkg.sh + + - name: 'Setup NuGet Credentials for vcpkg' + shell: 'bash' + run: | + mono `./dependencies/vcpkg/vcpkg fetch nuget | tail -n 1` \ + sources add \ + -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "${{ github.repository_owner }}" \ + -password "${{ secrets.GITHUB_TOKEN }}" + mono `./dependencies/vcpkg/vcpkg fetch nuget | tail -n 1` \ + setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + + - name: "cmake" + run: | + mkdir build + cd build + cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++ -G Ninja + + - name: "Build Cemu" + run: | + cmake --build build + + - name: Prepare artifact + if: ${{ inputs.deploymode == 'release' }} + run: chmod a+x bin/Cemu_release && mv bin/Cemu_release bin/Cemu + + - name: Upload artifact + uses: actions/upload-artifact@v3 + if: ${{ inputs.deploymode == 'release' }} + with: + name: cemu-bin-macos-x64 + path: ./bin/Cemu diff --git a/.github/workflows/deploy_experimental_release.yml b/.github/workflows/deploy_experimental_release.yml index afe3dee7..53afe4a8 100644 --- a/.github/workflows/deploy_experimental_release.yml +++ b/.github/workflows/deploy_experimental_release.yml @@ -25,6 +25,11 @@ jobs: name: cemu-bin-windows-x64 path: cemu-bin-windows-x64 + - uses: actions/download-artifact@v3 + with: + name: cemu-bin-macos-x64 + path: cemu-bin-macos-x64 + - name: Initialize run: | mkdir upload @@ -57,7 +62,16 @@ jobs: mv cemu-bin-linux-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-ubuntu-20.04-x64.zip ${{ env.CEMU_FOLDER_NAME }} rm -r ./${{ env.CEMU_FOLDER_NAME }} - + + - name: Create release from macos-bin + run: | + ls ./ + ls ./bin/ + cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }} + mv cemu-bin-macos-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu + zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.zip ${{ env.CEMU_FOLDER_NAME }} + rm -r ./${{ env.CEMU_FOLDER_NAME }} + - name: Create release run: | wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz diff --git a/.github/workflows/deploy_stable_release.yml b/.github/workflows/deploy_stable_release.yml index 7167dcbe..e0a7ac3d 100644 --- a/.github/workflows/deploy_stable_release.yml +++ b/.github/workflows/deploy_stable_release.yml @@ -27,6 +27,11 @@ jobs: name: cemu-bin-windows-x64 path: cemu-bin-windows-x64 + - uses: actions/download-artifact@v3 + with: + name: cemu-bin-macos-x64 + path: cemu-bin-macos-x64 + - name: Initialize run: | mkdir upload @@ -61,7 +66,16 @@ jobs: mv cemu-bin-linux-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-ubuntu-20.04-x64.zip ${{ env.CEMU_FOLDER_NAME }} rm -r ./${{ env.CEMU_FOLDER_NAME }} - + + - name: Create release from macos-bin + run: | + ls ./ + ls ./bin/ + cp -R ./bin ./${{ env.CEMU_FOLDER_NAME }} + mv cemu-bin-macos-x64/Cemu ./${{ env.CEMU_FOLDER_NAME }}/Cemu + zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-macos-12-x64.zip ${{ env.CEMU_FOLDER_NAME }} + rm -r ./${{ env.CEMU_FOLDER_NAME }} + - name: Create release run: | wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz