Skip to content

Commit

Permalink
switch to gon fork, apple is deprecating altool to notarize.
Browse files Browse the repository at this point in the history
I split the singing/notarization because Bearer fork does not implement `--deep` for signing
  • Loading branch information
umbynos committed Nov 6, 2023
1 parent 9358518 commit adef020
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
AC_USERNAME: ${{ secrets.AC_USERNAME }} # used by gon
AC_PASSWORD: ${{ secrets.AC_PASSWORD }} # used by gon
AC_PROVIDER: ${{ secrets.AC_PROVIDER }} # used by gon
# See: https://github.com/actions/setup-go/tree/v3#readme
GO_VERSION: "1.20"

Expand Down Expand Up @@ -261,7 +262,7 @@ jobs:
-k "${{ env.KEYCHAIN_PASSWORD }}" \
"${{ env.KEYCHAIN }}"
- name: Install gon for code signing and app notarization
- name: Install gon for code signing
uses: actions/checkout@v4
with:
repository: darkvertex/gon #this fork has support for --deep notarization
Expand All @@ -288,15 +289,42 @@ jobs:
deep = true
}
# Ask Gon for zip output to force notarization process to take place.
# The CI will upload the zip output
EOF
- name: Sign binary
run: gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"

- name: Remove gon used for code signing
run: |
rm /usr/local/bin/gon
rm ${{ env.GON_CONFIG_PATH }}
- name: Install gon for app notarization
run: |
wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip
unzip gon_macos.zip -d /usr/local/bin
- name: Write gon config to file
run: |
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
# See: https://github.com/Bearer/gon#configuration-file
source = ["ArduinoCreateAgent.app"]
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
notarize {
path = "ArduinoCreateAgent.app"
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
staple = true
}
zip {
output_path = "ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip"
}
EOF
- name: Sign and notarize binary
run: gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
- name: Notarize binary
run: |
gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
- name: Upload autoupdate bundle to Arduino downloads servers
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
Expand Down Expand Up @@ -475,7 +503,7 @@ jobs:
- name: Install gon for code signing and app notarization
run: |
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.5/gon_macos.zip
wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip
unzip gon_macos.zip -d /usr/local/bin
- name: Write gon config to file
Expand All @@ -490,17 +518,13 @@ jobs:
}
# Ask Gon for zip output to force notarization process to take place.
# The CI will not upload the zip output
zip {
output_path = "ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip"
}
EOF
- name: Code sign and notarize app
run: |
echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg"
gon -log-level=debug -log-json gon.config_installer.hcl
timeout-minutes: 30
run: gon -log-level=debug -log-json gon.config_installer.hcl

# tar dmg file to keep executable permission
- name: Tar files to keep permissions
Expand Down

0 comments on commit adef020

Please sign in to comment.