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

docs: WIP Mac codesigning docs #1372

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

docs: WIP Mac codesigning docs #1372

wants to merge 1 commit into from

Conversation

mistydemeo
Copy link
Contributor

Documents the feature we added in #1361. This is currently a WIP until I have access to a developer account so I can confirm the precise steps to walk people through.

I believe it's possible to get a cert either via the web or through Xcode. I'm going to focus on documenting the web route if that's feasible, so users don't have to install Xcode.

@fasterthanlime
Copy link
Contributor

I ran into this while doing docs work and noticed that the macOS Codesigning section still had a 🔜 emoji in there x)

You'll need the following three secrets:

- `CODESIGN_IDENTITY`: the identity in the certificate
- `CODESIGN_CERTIFICATE_PASSWORD`: this is the base64-encoded certificate from Step 4
Copy link

@jamesmunns jamesmunns Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be CODESIGN_CERTIFICATE? (edit: yes!)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `CODESIGN_CERTIFICATE_PASSWORD`: this is the base64-encoded certificate from Step 4
- `CODESIGN_CERTIFICATE`: this is the base64-encoded certificate from Step 4


You'll need the following three secrets:

- `CODESIGN_IDENTITY`: the identity in the certificate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be the "User ID" from the certificate? e.g. the part of the name at the end like (XXXXXXXXXX)?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - this seems to work!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the docs to make that clearer!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: you can find that ID also with security find-identity -v -p codesigning from the terminal.

@jamesmunns
Copy link

Just noting that I followed these instructions after creating a "Developer ID Application" key, and cargo-dist was able to sign the app successfully (it seems?).

I'm currently waiting to see if Apple will notarize this, I currently do not build a package or installer, though I probably should as the notary tool requires the app to be in a pkg or dmg or zip. The first notarization has taken >4h so far, but some searching on the internet says that this isn't too unusual (and that later notarizations might take longer), so dist tooling might not want to use the --wait argument.

I notarized using:

xcrun notarytool submit ./MY_APP.zip --keychain-profile "MY_KEYCHAIN_PROFILE" --wait

@mistydemeo
Copy link
Contributor Author

Four hours 😱 I forget how long it can take sometimes. At my last gig it was usually only taking us a few minutes.

Thanks for the docs feedback - that's very helpful!

@wolfv
Copy link

wolfv commented Nov 26, 2024

FYI Instead of going through keychain it's also possible to get / export the certificates in XCode:

Screenshot 2024-11-26 at 16 11 43 Screenshot 2024-11-26 at 16 11 16

@wolfv
Copy link

wolfv commented Nov 26, 2024

This also seems to give a p12 file by default.

Screenshot 2024-11-26 at 16 12 42

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.

4 participants