let's see if this works #1147
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS | |
on: | |
push: | |
branches: | |
- master | |
- ci/* | |
pull_request: | |
branches: | |
- master | |
env: | |
MELONDS_GIT_BRANCH: ${{ github.ref }} | |
MELONDS_GIT_HASH: ${{ github.sha }} | |
MELONDS_BUILD_PROVIDER: GitHub Actions | |
MELONDS_VERSION_SUFFIX: " RC" | |
jobs: | |
build-macos: | |
strategy: | |
matrix: | |
arch: [x86_64, arm64] | |
name: ${{ matrix.arch }} | |
runs-on: macos-14 | |
steps: | |
- name: Check out sources | |
uses: actions/checkout@v3 | |
- name: Install dependencies for package building | |
run: | | |
brew install autoconf automake autoconf-archive libtool python-setuptools | |
- name: Set up CMake | |
uses: lukka/get-cmake@latest | |
- name: Set up vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c | |
- name: Build | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: release-mac-${{ matrix.arch }} | |
buildPreset: release-mac-${{ matrix.arch }} | |
configurePresetAdditionalArgs: "['-DMELONDS_EMBED_BUILD_INFO=ON']" | |
- name: Prepare app bundle | |
shell: bash | |
run: | | |
mkdir app | |
mv build/release-mac-${{ matrix.arch }}/melonDS.app app | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macOS-${{ matrix.arch }} | |
path: app | |
retention-days: 1 | |
universal-binary: | |
name: Universal binary | |
needs: [build-macos] | |
runs-on: macos-13 | |
continue-on-error: true | |
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: | | |
lipo {x86_64,arm64}/melonDS.app/Contents/MacOS/melonDS -create -output melonDS | |
mkdir app | |
cp -a arm64/melonDS.app app | |
cp melonDS app/melonDS.app/Contents/MacOS/melonDS | |
codesign -s - --deep app/melonDS.app | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macOS-universal | |
path: app | |
# - name: Clean up architecture-specific artifacts | |
# uses: geekyeggo/delete-artifact@v4 | |
# with: | |
# failOnError: false | |
# name: | | |
# macOS-x86_64 | |
# macOS-arm64 |