Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: switch osx build to codesign and notarytool #1078

Merged
merged 11 commits into from
Apr 10, 2024
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Apr 9, 2024

This PR replaces gon (no longer maintained tool for signing and notarizing macOS software on CI) with modern/new CLI tools provided by Apple: codesign and notarytool.

To be honest, I've been fixing signing and/or notarization of dist.ipfs.tech or ipfs-desktop at least once a year due to tool changes /deprecations.

Hopefully, using official tools from Apple will reduce surface for breakage.

Closes #1066

TODO

  • remove unmaintained gon
  • evaluate rcodesign
  • signing with codesign
  • notarization with notarytool
    • refactor .sh script to notarize final .zip (with signed binary inside) (to fix this error)
  • concurrency protection on master branch
  • document where we would plug rcodesign if we ever have to move away from macOS worker and Apple tools

Appendix: why we are not using rcodesign right now

This PR was exploring switching from macos runner to linux one that does signing with rcodesign mentioned in #1066 (comment) (Used by Mozila for signing and notarizing things like Tor Browser).

The downside was that, iiuc (not a macOS person), we would need to generate new secrets related to notarization, because old user/app-specific pass no longer work with rcodesign.

New things are: APPLE_APIKEY_ISSUER_ID, APPLE_APIKEY_ID, and APPLE_APIKEY_FILE, and they likely require uber-admin of Apple Developer Org to do special dance to generate them, which is doable, but would take multiple days or weeks to do, bunch of unknowns / extra work because of where we are with IPFS/PL/Shipyard nucleation state.

To avoid unnecessary time sink, I'm parking this for now.

CLI Tools codesign and notarytool from apple seem to be good enough these days. This is approach big projects like NodeJS use (#1066 (comment)), and allows us to fix signing and notarization without having to switch org and generating new secrets.


Obligatory:


Hieronymus Bosch, The Process of fixing Apple Notarization, oil on wood, 1475.

@lidel lidel changed the base branch from kubo-v0.28.0-rc1 to master April 9, 2024 19:10

This comment was marked as off-topic.

@lidel
Copy link
Member Author

lidel commented Apr 10, 2024

Good news, confirmed both signing and notarization setup from 69c061a produced amd64 Mach-O binary that is signed and notarized.

Tested on macMini with macOS 13.2.1 and ipfs --version was executed correctly, was not blocked by Apple's Gatekeeper system.

Now I will clean things up and merge back into master and then into #1077.
This way it will be easier to git blame signing code.

@lidel lidel changed the title wip: switch osx signing to rcodesign fix: switch osx build to codesign and notarytool Apr 10, 2024
lidel added 10 commits April 10, 2024 16:28
this is wip, we will pick this up once we have to move away from
legacy secrets from PL times

switching to rcodesign will allow us to run on faster linux workers

the downside is that we need to generate new secrets related
to notarization, because old user/app-specific pass no longer work with
rcodesign
APPLE_APIKEY_ISSUER_ID
APPLE_APIKEY_ID
APPLE_APIKEY_FILE
this hybrid approach aims to allow us to sign using existing legacy
secrets on existing macos worker.

we replace gon with rcodesign for signing, but do notarization with
notarytool from apple
Copy link

This change produced no new differences in built artifacts.

@lidel lidel marked this pull request as ready for review April 10, 2024 14:54
@lidel lidel merged commit 8c700ab into master Apr 10, 2024
5 checks passed
@lidel lidel deleted the fix/osx-notarization branch April 10, 2024 14:55
This was referenced Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch Apple Notarization from gon/altool to notarytool.
1 participant