diff options
author | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2023-12-28 15:03:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 15:03:44 +0100 |
commit | da264539119c70afcbcab1e48fc4641e4201e6cd (patch) | |
tree | 29b61d1e47d1811c1ee7c6831dcb5202e5cc578c /.github/workflows/build-macos.yml | |
parent | a4b2b0c40df15713a5efa114310bf78fd369d0f4 (diff) |
CI stuff (#1935)
Add new macOS CI using vcpkg
Diffstat (limited to '.github/workflows/build-macos.yml')
-rw-r--r-- | .github/workflows/build-macos.yml | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml new file mode 100644 index 0000000..6d5693a --- /dev/null +++ b/.github/workflows/build-macos.yml @@ -0,0 +1,84 @@ +name: macOS + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build-macos: + strategy: + matrix: + arch: [x86_64, arm64] + + name: ${{ matrix.arch }} + runs-on: macos-13 + steps: + - name: Check out sources + uses: actions/checkout@v3 + - name: Install dependencies for package building + run: | + brew install autoconf automake autoconf-archive libtool && pip3 install setuptools + - name: Set up CMake + uses: lukka/get-cmake@latest + - name: Set up vcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: c8696863d371ab7f46e213d8f5ca923c4aef2a00 + - name: Build + uses: lukka/run-cmake@v10 + with: + configurePreset: release-mac-${{ matrix.arch }} + buildPreset: release-mac-${{ matrix.arch }} + - name: Compress app bundle + shell: bash + run: | + cd build/release-mac-${{ matrix.arch }} + zip -r -y ../../macOS-${{ matrix.arch }}.zip melonDS.app + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: macOS-${{ matrix.arch }} + path: macOS-${{ matrix.arch }}.zip + + universal-binary: + name: Universal binary + needs: [build-macos] + runs-on: macos-13 + steps: + - name: Download x86_64 + uses: actions/download-artifact@v4 + with: + name: macOS-x86_64 + path: x86_64 + - name: Download arm64 + uses: actions/download-artifact@v4 + with: + name: macOS-arm64 + path: arm64 + - name: Combine app bundles + shell: bash + run: | + unzip x86_64/*.zip -d x86_64 + unzip arm64/*.zip -d arm64 + lipo {x86_64,arm64}/melonDS.app/Contents/MacOS/melonDS -create -output melonDS + cp -a arm64/melonDS.app melonDS.app + cp melonDS melonDS.app/Contents/MacOS/melonDS + codesign -s - --deep melonDS.app + zip -r -y macOS-universal.zip melonDS.app + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: macOS-universal + path: macOS-universal.zip + - name: Clean up architecture-specific artifacts + uses: geekyeggo/delete-artifact@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + failOnError: false + name: | + macOS-x86_64 + macOS-arm64 |