forked from supercollider/supercollider
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (184 loc) · 9.01 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Build Mac OS
on:
workflow_call:
inputs:
sc-version:
required: true
type: string
jobs:
build-macos:
runs-on: macos-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: "arm64"
os-version: "15"
xcode-version: "16.0"
qt-version: "6.7.3" # will use qt from aqtinstall
qt-modules: 'qtwebengine qtwebchannel qtwebsockets qtpositioning'
deployment-target: "11"
cmake-architectures: "arm64"
homebrew-packages: "libsndfile readline fftw portaudio"
vcpkg-packages: ""
vcpkg-triplet: ""
extra-cmake-flags: "" # -D SC_VERIFY_APP=ON # verify app doesn't seem to work with official qt6
artifact-suffix: "macOS-arm64"
- job-name: "x64"
os-version: "13"
xcode-version: "15.2"
qt-version: "6.7.3" # will use qt from aqtinstall
qt-modules: 'qtwebengine qtwebchannel qtwebsockets qtpositioning'
deployment-target: "11"
cmake-architectures: "x86_64"
homebrew-packages: "libsndfile readline fftw portaudio"
vcpkg-packages: ""
vcpkg-triplet: ""
extra-cmake-flags: "" # -D SC_VERIFY_APP=ON # verify app doesn't seem to work with official qt6
artifact-suffix: "macOS-x64"
- job-name: "x64 legacy"
os-version: "13"
xcode-version: "14.1"
qt-version: "5.15.2" # will use qt from aqtinstall
qt-modules: 'qtwebengine'
deployment-target: "10.15"
cmake-architectures: x86_64
homebrew-packages: "readline portaudio"
vcpkg-packages: "libsndfile fftw3"
# homebrew-packages: "" # use this instead when cross-compiling for x86_64 on arm64
# homebrew-uninstall: "readline" # use this instead when cross-compiling for x86_64 on arm64
# vcpkg-packages: "readline portaudio libsndfile fftw3" # use this instead when cross-compiling for x86_64 on arm64
vcpkg-triplet: x64-osx-release-supercollider # required for build-libsndfile
extra-cmake-flags: ""
artifact-suffix: "macOS-x64-legacy" # set if needed - will trigger artifact upload
- job-name: "x64 use system libraries"
os-version: "13"
xcode-version: "15.2"
deployment-target: ""
cmake-architectures: x86_64
homebrew-packages: "qt@6 libsndfile readline fftw portaudio yaml-cpp boost"
vcpkg-packages: ""
vcpkg-triplet: ""
extra-cmake-flags: "-D SYSTEM_BOOST=ON -D SYSTEM_YAMLCPP=ON"
- job-name: "x64 shared libscsynth"
os-version: "13"
xcode-version: "15.2"
deployment-target: ""
cmake-architectures: x86_64
homebrew-packages: "qt@6 libsndfile readline fftw portaudio"
vcpkg-packages: ""
vcpkg-triplet: ""
extra-cmake-flags: "-D LIBSCSYNTH=ON"
name: macOS ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_ENV_HINTS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
USE_SYSLIBS: ${{ matrix.use-syslibs }}
SHARED_LIBSCSYNTH: ${{ matrix.shared-libscsynth }}
ARTIFACT_FILE: "SuperCollider-${{ inputs.sc-version }}-${{ matrix.artifact-suffix }}.dmg"
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer"
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.deployment-target }}"
CMAKE_OSX_ARCHITECTURES: "${{ matrix.cmake-architectures }}"
BREW_UNIVERSAL_WORKDIR: ${{ github.workspace }}/brew-universal
SKIP_SIGNING: 1 # for brew-install-universal
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: prepare timestamp for cache
id: current-date
run: |
echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "week=$(date '+%U')" >> $GITHUB_OUTPUT
- name: cache ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.cmake-architectures }}${{ matrix.extra-cmake-flags }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.cmake-architectures }}${{ matrix.extra-cmake-flags }}-
- name: cleanup homebrew downloads # always remove existing downloads first, as we bring back relevant downloads from cache
run: rm -rf $(brew --cache)/downloads
- name: cache homebrew downloads
uses: actions/cache@v4
id: cache-homebrew
with:
path: ~/Library/Caches/Homebrew/downloads
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-architectures }}-homebrew-${{ steps.current-date.outputs.week }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-architectures }}-homebrew-
- name: cache vcpkg
if: matrix.vcpkg-triplet
uses: actions/cache@v4
with:
path: ~/.cache/vcpkg/archives
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.vcpkg-triplet }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.vcpkg-triplet }}-
- name: setup ccache
run: |
brew install ccache --quiet
# add ccache to PATH
echo "`brew --prefix ccache`/libexec" >> $GITHUB_PATH
- name: setup vcpkg # vcpkg is not automatically installed in newer macOS runner images
if: matrix.vcpkg-packages && matrix.vcpkg-triplet
run: |
if [[ -z "${VCPKG_INSTALLATION_ROOT}" ]]; then
cd ${{ github.workspace }}/..
echo "setting up vcpkg in `pwd`"
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
ls -a
./bootstrap-vcpkg.sh
echo "VCPKG_INSTALLATION_ROOT=`pwd`" >> $GITHUB_ENV # use the same env var that was used for VCPKG in older runner images
echo "`pwd`" >> $GITHUB_PATH
fi
- name: install homebrew packages
if: matrix.homebrew-packages
run: brew install ${{ matrix.homebrew-packages }} --quiet
- name: install vcpkg packages
if: matrix.vcpkg-packages && matrix.vcpkg-triplet
run: |
if [[ -n "${{ matrix.homebrew-uninstall }}" ]]; then brew uninstall --ignore-dependencies ${{ matrix.homebrew-uninstall }}; fi
vcpkg install ${{ matrix.vcpkg-packages }} --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: install qt using aqtinstall
uses: jurplel/install-qt-action@v3
if: matrix.qt-version
env:
DEVELOPER_DIR: "" # remove developer dir which causes installation to fail
with:
modules: ${{ matrix.qt-modules }}
version: ${{ matrix.qt-version }}
cache: true
cache-key-prefix: ${{ runner.os }}-qt${{ matrix.qt-version }}-${{ matrix.qt-modules }}
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
CMAKE_FLAGS="-G Xcode -D RULE_LAUNCH_COMPILE=ccache -D SUPERNOVA=ON ${{ matrix.extra-cmake-flags }}"
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
CMAKE_FLAGS="-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg-triplet }} -DCMAKE_BUILD_TYPE=Release $CMAKE_FLAGS"
fi
echo "CMAKE_FLAGS:" $CMAKE_FLAGS
cmake $CMAKE_FLAGS ..
- name: build
run: cmake --build $BUILD_PATH --config Release --target install
- name: create archive
if: matrix.artifact-suffix
run: |
cd $INSTALL_PATH
ln -s /Applications SuperCollider/Applications
mkdir -p SuperCollider/.background
cp ../../package/background_2_arrow.png SuperCollider/.background/background_2_arrow.png
cp ../../package/ds_store SuperCollider/.DS_Store
# the following assumes that we end up with the build in the folder SuperCollider
# hdiutil sometimes fails with "create failed - Resource busy"
# when that happens, we run it again
hdiutil create -srcfolder SuperCollider -format UDZO -fs HFS+ $ARTIFACT_FILE || hdiutil create -srcfolder SuperCollider -format UDZO -fs HFS+ $ARTIFACT_FILE
- name: upload artifacts
uses: actions/upload-artifact@v4
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}