Skip to content

Commit adef020

Browse files
committed
switch to gon fork, apple is deprecating altool to notarize.
I split the singing/notarization because Bearer fork does not implement `--deep` for signing
1 parent 9358518 commit adef020

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

.github/workflows/release.yml

+36-12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
2121
AC_USERNAME: ${{ secrets.AC_USERNAME }} # used by gon
2222
AC_PASSWORD: ${{ secrets.AC_PASSWORD }} # used by gon
23+
AC_PROVIDER: ${{ secrets.AC_PROVIDER }} # used by gon
2324
# See: https://github.com/actions/setup-go/tree/v3#readme
2425
GO_VERSION: "1.20"
2526

@@ -261,7 +262,7 @@ jobs:
261262
-k "${{ env.KEYCHAIN_PASSWORD }}" \
262263
"${{ env.KEYCHAIN }}"
263264
264-
- name: Install gon for code signing and app notarization
265+
- name: Install gon for code signing
265266
uses: actions/checkout@v4
266267
with:
267268
repository: darkvertex/gon #this fork has support for --deep notarization
@@ -288,15 +289,42 @@ jobs:
288289
deep = true
289290
}
290291
291-
# Ask Gon for zip output to force notarization process to take place.
292-
# The CI will upload the zip output
292+
EOF
293+
294+
- name: Sign binary
295+
run: gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
296+
297+
- name: Remove gon used for code signing
298+
run: |
299+
rm /usr/local/bin/gon
300+
rm ${{ env.GON_CONFIG_PATH }}
301+
302+
- name: Install gon for app notarization
303+
run: |
304+
wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip
305+
unzip gon_macos.zip -d /usr/local/bin
306+
307+
- name: Write gon config to file
308+
run: |
309+
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
310+
# See: https://github.com/Bearer/gon#configuration-file
311+
source = ["ArduinoCreateAgent.app"]
312+
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
313+
314+
notarize {
315+
path = "ArduinoCreateAgent.app"
316+
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
317+
staple = true
318+
}
319+
293320
zip {
294321
output_path = "ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip"
295322
}
296323
EOF
297-
298-
- name: Sign and notarize binary
299-
run: gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
324+
325+
- name: Notarize binary
326+
run: |
327+
gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
300328
301329
- name: Upload autoupdate bundle to Arduino downloads servers
302330
run: aws s3 cp ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}${GITHUB_REF/refs\/tags\//}/ # the version should be created in th the build job
@@ -475,7 +503,7 @@ jobs:
475503
476504
- name: Install gon for code signing and app notarization
477505
run: |
478-
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.5/gon_macos.zip
506+
wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip
479507
unzip gon_macos.zip -d /usr/local/bin
480508
481509
- name: Write gon config to file
@@ -490,17 +518,13 @@ jobs:
490518
}
491519
492520
# Ask Gon for zip output to force notarization process to take place.
493-
# The CI will not upload the zip output
494521
zip {
495522
output_path = "ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip"
496523
}
497524
EOF
498525
499526
- name: Code sign and notarize app
500-
run: |
501-
echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg"
502-
gon -log-level=debug -log-json gon.config_installer.hcl
503-
timeout-minutes: 30
527+
run: gon -log-level=debug -log-json gon.config_installer.hcl
504528

505529
# tar dmg file to keep executable permission
506530
- name: Tar files to keep permissions

0 commit comments

Comments
 (0)