@@ -149,22 +149,85 @@ jobs:
149
149
config.ini
150
150
if-no-files-found : error
151
151
152
- # The code-sign-mac-executable job will download the macos artifact from the previous job, sign e notarize the binary and re-upload it.
153
- code-sign-mac-executable :
152
+ create-macos-bundle :
154
153
needs : build
155
- strategy :
156
- matrix : # to allow support for future architectures
157
- os : [macos-12]
158
- arch : [-amd64]
159
154
160
- runs-on : ${{ matrix.os }}
155
+ runs-on : macos-12
156
+ env :
157
+ EXE_PATH : " skel/ArduinoCreateAgent.app/Contents/MacOS/"
158
+
159
+ steps :
160
+ - name : Checkout
161
+ uses : actions/checkout@v3
162
+ with :
163
+ repository : ' bcmi-labs/arduino-create-agent-installer' # the repo which contains the bundle structure and icons
164
+ token : ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }}
165
+
166
+ - name : Download artifact
167
+ uses : actions/download-artifact@v3
168
+ with :
169
+ name : ${{ env.PROJECT_NAME }}-macos-12-amd64
170
+ path : ${{ env.EXE_PATH }}
171
+
172
+ - name : Remove placeholder file
173
+ run : rm -rf ${{ env.EXE_PATH }}.empty
174
+
175
+ # zip artifacts do not mantain executable permission
176
+ - name : Make executable
177
+ run : chmod -v +x ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }}
178
+
179
+ - name : Rename executable to Arduino_Create_Agent
180
+ run : mv -v ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} ${{ env.EXE_PATH }}Arduino_Create_Agent
181
+
182
+ - name : get year
183
+ run : echo "YEAR=$(date "+%Y")" >> $GITHUB_ENV
184
+
185
+ - name : Generate Info.plist for MacOS
186
+ run : |
187
+ cat > skel/ArduinoCreateAgent.app/Contents/Info.plist <<EOF
188
+ <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
189
+
190
+ <key>CFBundleIconFile</key> <string>AppIcon.icns</string>
191
+
192
+ <key>CFBundleName</key> <string>Arduino Create Agent</string>
193
+ <key>CFBundleExecutable</key> <string>Arduino_Create_Agent</string>
194
+ <key>CFBundleIdentifier</key> <string>create.arduino.cc</string>
195
+
196
+ <key>CFBundleVersion</key> <string>${GITHUB_REF##*/}</string>
197
+ <key>NSHumanReadableCopyright</key> <string>© Copyright ${{ env.YEAR }} Arduino LLC</string>
198
+ <key>CFBundleShortVersionString</key> <string>${GITHUB_REF##*/}</string>
199
+ <key>LSUIElement</key> <true/>
200
+ <!-- Needed for Apache Callback -->
201
+ <key>NSPrincipalClass</key><string>NSApplication</string>
202
+ <key>NSMainNibFile</key><string>MainMenu</string>
203
+
204
+ </dict></plist>
205
+ EOF
206
+
207
+ - name : Tar bundle to keep permissions
208
+ run : tar -cvf ArduinoCreateAgent.app.tar -C skel/ .
209
+
210
+ - name : Upload artifacts
211
+ uses : actions/upload-artifact@v3
212
+ with :
213
+ if-no-files-found : error
214
+ name : ArduinoCreateAgent.app
215
+ path : ArduinoCreateAgent.app.tar
216
+
217
+ # The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it.
218
+ notarize-macos :
219
+ name : Notarize bundle
220
+ runs-on : macos-12
221
+ needs : create-macos-bundle
161
222
162
223
steps :
163
224
- name : Download artifact
164
225
uses : actions/download-artifact@v3
165
226
with :
166
- name : arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
167
- path : arduino-create-agent
227
+ name : ArduinoCreateAgent.app
228
+
229
+ - name : un-Tar bundle
230
+ run : tar -xvf ArduinoCreateAgent.app.tar
168
231
169
232
- name : Import Code-Signing Certificates
170
233
run : |
@@ -195,7 +258,7 @@ jobs:
195
258
run : |
196
259
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
197
260
# See: https://github.com/mitchellh/gon#configuration-file
198
- source = ["${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }} "]
261
+ source = ["ArduinoCreateAgent.app "]
199
262
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
200
263
201
264
sign {
@@ -224,7 +287,7 @@ jobs:
224
287
225
288
# This job is responsible for generating the installers (using installbuilder)
226
289
package :
227
- needs : code-sign-mac-executable
290
+ needs : notarize-macos
228
291
runs-on : ubuntu-20.04
229
292
230
293
env :
@@ -289,42 +352,16 @@ jobs:
289
352
# zip artifacts do not mantain executable permission
290
353
- name : Make executable
291
354
run : chmod -v +x ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}*
292
- if : matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-12'
355
+ if : matrix.os == 'ubuntu-20.04'
293
356
294
357
- name : Rename executable to Arduino_Create_Agent
295
358
run : mv -v ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }}
359
+ if : matrix.os != 'macos-12'
296
360
297
361
- name : Rename executable to Arduino_Create_Agent_cli
298
362
run : mv -v ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }}
299
363
if : matrix.os == 'ubuntu-20.04'
300
364
301
- - name : get year
302
- run : echo "YEAR=$(date "+%Y")" >> $GITHUB_ENV
303
- if : matrix.os == 'macos-12'
304
-
305
- - name : Generate Info.plist for MacOS
306
- run : |
307
- cat > skel/ArduinoCreateAgent.app/Contents/Info.plist <<EOF
308
- <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
309
-
310
- <key>CFBundleIconFile</key> <string>AppIcon.icns</string>
311
-
312
- <key>CFBundleName</key> <string>Arduino Create Agent</string>
313
- <key>CFBundleExecutable</key> <string>Arduino_Create_Agent</string>
314
- <key>CFBundleIdentifier</key> <string>create.arduino.cc</string>
315
-
316
- <key>CFBundleVersion</key> <string>${GITHUB_REF##*/}</string>
317
- <key>NSHumanReadableCopyright</key> <string>© Copyright ${{ env.YEAR }} Arduino LLC</string>
318
- <key>CFBundleShortVersionString</key> <string>${GITHUB_REF##*/}</string>
319
- <key>LSUIElement</key> <true/>
320
- <!-- Needed for Apache Callback -->
321
- <key>NSPrincipalClass</key><string>NSApplication</string>
322
- <key>NSMainNibFile</key><string>MainMenu</string>
323
-
324
- </dict></plist>
325
- EOF
326
- if : matrix.os == 'macos-12'
327
-
328
365
- name : Save InstallBuilder license to file
329
366
run : echo "${{ secrets.INSTALLER_LICENSE }}" > /tmp/license.xml
330
367
0 commit comments