-
Notifications
You must be signed in to change notification settings - Fork 3
309 lines (268 loc) · 9.28 KB
/
build-osx.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
name: Build MacOS
on:
workflow_dispatch:
workflow_call:
push:
branches:
- 'master'
tags:
- '*'
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
MODE: release
TARGET_OS: osx
TARGET_ARCH: ${{ matrix.arch }}
TARGET_CPUREV: ${{ matrix.cpurev }}
JOBS: 4
strategy:
fail-fast: false
matrix:
os: [macos-13,macos-14]
arch: [x64,arm64]
cpurev: [legacy, default, modern]
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# Clang Version
- name: Clang Version
run: clang --version
# Build
- name: Build
run: |
make -j${{ env.JOBS }}
# Binary Info (CppCore.Example.Server)
- name: Binary Info (CppCore.Example.Server)
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Example.Server
# Binary Info (CppCore.Example.Client)
- name: Binary Info (CppCore.Example.Client)
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Example.Client
# Binary Info (CppCore.Example.UI)
- name: Binary Info (CppCore.Example.UI)
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Example.UI
# Binary Info (CppCore.Test)
- name: Binary Info (CppCore.Test)
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Test
# Binary Info (CppCore.Debug)
- name: Binary Info (CppCore.Debug)
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Debug
# Binary Info (CppCore.Interface.C)
- name: Binary Info (CppCore.Interface.C)
run: otool -l ./build/make/lib/osx-${{ matrix.arch }}/libcppcore.dylib
# Test
- name: Test
if: |
(matrix.os == 'macos-12' && matrix.arch == 'x64') ||
(matrix.os == 'macos-13' && matrix.arch == 'x64') ||
(matrix.os == 'macos-14' && matrix.arch == 'arm64') ||
(matrix.os == 'macos-14' && matrix.arch == 'x64' && matrix.cpurev == 'legacy')
run: make test
# Upload Binaries
- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: Binaries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }})
path: |
./build/make/bin/osx-${{ matrix.arch }}/*
!./build/make/bin/osx-${{ matrix.arch }}/.gitignore
# Upload Libraries
- name: Upload Libraries
uses: actions/upload-artifact@v4
with:
name: Libraries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }})
path: |
./build/make/lib/osx-${{ matrix.arch }}/*
!./build/make/lib/osx-${{ matrix.arch }}/.gitignore
# Upload lto.o
- name: Upload lto.o
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: lto.o (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }})
path: ./build/make/obj/osx-${{ matrix.arch }}-release/**/lto.o
###########################################################################
dist:
needs: build
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [macos-13]
cpurev: [legacy, default, modern]
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# Download X64 Binaries
- name: Download X64 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-x64-${{ matrix.cpurev }})
path: ./build/make/bin/osx-x64/
# Download X64 Libraries
- name: Download X64 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-x64-${{ matrix.cpurev }})
path: ./build/make/lib/osx-x64/
# Download X64 lto.o
- name: Download X64 lto.o
uses: actions/download-artifact@v4
with:
name: lto.o (${{ matrix.os }}-x64-${{ matrix.cpurev }})
path: ./build/make/obj/osx-x64-release/
# Download ARM64 Binaries
- name: Download ARM64 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-arm64-${{ matrix.cpurev }})
path: ./build/make/bin/osx-arm64/
# Download ARM64 Libraries
- name: Download ARM64 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-arm64-${{ matrix.cpurev }})
path: ./build/make/lib/osx-arm64/
# Download ARM64 lto.o
- name: Download ARM64 lto.o
uses: actions/download-artifact@v4
with:
name: lto.o (${{ matrix.os }}-arm64-${{ matrix.cpurev }})
path: ./build/make/obj/osx-arm64-release/
# Load Code Signing Certificate
- name: Load Code Signing Certificate
env:
PFX_BASE64: ${{ secrets.SIGN_PFX_FILE_OSX }}
run: |
echo $PFX_BASE64 > ./certs/TrueCert.pfx.base64
base64 --decode -i ./certs/TrueCert.pfx.base64 -o ./certs/TrueCert.pfx
# Pack
- name: Distribution Packages
env:
SIGN_PFX_FILE: ../../certs/TrueCert.pfx
SIGN_PFX_PASS: ${{ secrets.SIGN_PFX_PASS_OSX }}
PUBLISHERCN: "Developer ID Application: Clint Banzhaf (43RQ46H6CR)"
PRODUCTSIGNCN: "Developer ID Installer: Clint Banzhaf (43RQ46H6CR)"
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APPSPEC_PASS: ${{ secrets.APPLE_APPSPEC_PASS }}
APPLE_DIST_STORE: false
run: make dist
# Install Python
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
# Make (dist-python)
- name: Make (dist-python)
run: |
python --version
python -m pip install build
make CppCore.Interface.Python
# Test
- name: Test Python
if: matrix.cpurev != 'modern'
run: |
cd src/CppCore.Interface.Python
python -m pip install pytest crc32c pbkdf2-reboot
pytest
# Upload
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Packages (${{ matrix.os }}-${{ matrix.cpurev }})
path: |
./dist/osx-10.15/*-universal.pkg
./dist/osx-10.15/*-universal.tar.gz
./dist/osx-10.15/*.whl
# Upload to Github Release
- name: Upload to Github Release
uses: softprops/action-gh-release@v1
if: matrix.cpurev == 'default' && startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.PAT_GITHUB_ACTIONS }}
files: |
./dist/osx-10.15/*-universal.pkg
./dist/osx-10.15/*-universal.tar.gz
###########################################################################
dist-store:
needs: build
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [macos-13]
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# Download X64 Binaries
- name: Download X64 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-x64-default)
path: ./build/make/bin/osx-x64/
# Download X64 Libraries
- name: Download X64 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-x64-default)
path: ./build/make/lib/osx-x64/
# Download X64 lto.o
- name: Download X64 lto.o
uses: actions/download-artifact@v4
with:
name: lto.o (${{ matrix.os }}-x64-default)
path: ./build/make/obj/osx-x64-release/
# Download ARM64 Binaries
- name: Download ARM64 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-arm64-default)
path: ./build/make/bin/osx-arm64/
# Download ARM64 Libraries
- name: Download ARM64 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-arm64-default)
path: ./build/make/lib/osx-arm64/
# Download ARM64 lto.o
- name: Download ARM64 lto.o
uses: actions/download-artifact@v4
with:
name: lto.o (${{ matrix.os }}-arm64-default)
path: ./build/make/obj/osx-arm64-release/
# Load Code Signing Certificate
- name: Load Code Signing Certificate
env:
PFX_BASE64: ${{ secrets.SIGN_PFX_FILE_OSX }}
run: |
echo $PFX_BASE64 > ./certs/TrueCert.pfx.base64
base64 --decode -i ./certs/TrueCert.pfx.base64 -o ./certs/TrueCert.pfx
# Pack
- name: Distribution Packages
env:
SIGN_PFX_FILE: ../../certs/TrueCert.pfx
SIGN_PFX_PASS: ${{ secrets.SIGN_PFX_PASS_OSX }}
PUBLISHERCN: "3rd Party Mac Developer Application: Clint Banzhaf (43RQ46H6CR)"
PRODUCTSIGNCN: "3rd Party Mac Developer Installer: Clint Banzhaf (43RQ46H6CR)"
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APPSPEC_PASS: ${{ secrets.APPLE_APPSPEC_PASS }}
APPLE_DIST_STORE: true
APPLE_UPLOAD_STORE: ${{ startsWith(github.ref, 'refs/tags/0.') || startsWith(github.ref, 'refs/tags/1.') || startsWith(github.ref, 'refs/tags/2.') }}
run: make dist
# Upload
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Packages Store (${{ matrix.os }})
path: |
./dist/osx-10.15/*-universal.pkg
./dist/osx-10.15/*-universal.tar.gz