-
-
Notifications
You must be signed in to change notification settings - Fork 552
89 lines (84 loc) · 2.52 KB
/
build-macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
zip -r -y macOS-${{ matrix.arch }}.zip \
build/release-mac-${{ matrix.arch }}/melonDS.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macOS-${{ matrix.arch }}
path: macOS-${{ matrix.arch }}.zip
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
- name: Combine app bundles
shell: bash
run: |
uznip x86_64/melonDS-x86_64.zip -d x86_64
unzip melonDS-arm64.zip
lipo {.,x86_64}/melonDS.app/Contents/MacOS/melonDS -create -output melonDS
cp melonDS melonDS.app/Contents/MacOS/melonDS
- name: Create disk image
shell: bash
run: |
ln -s /Applications app/Applications
hdiutil create -fs HFS+ -volname melonDS -srcfolder app -ov -format UDBZ melonDS.dmg
codesign -s - --deep melonDS.dmg
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macOS-universal
path: melonDS.dmg