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

Add signed package build and App Store submission for Mac #3309

Closed
wants to merge 2 commits into from

Conversation

softins
Copy link
Member

@softins softins commented Jul 11, 2024

Short description of changes

This PR adds automation to create a signed pkg (installer) file for direct submission to the macOS App Store, and was originally authored by @danryu.

This PR replaces #2624 and squashes all the changes made by Dan G into one commit. They have also been rebased on to the latest main, as the original PR was based on a main that was at least a year old.

CHANGELOG: Build: adds macOS signed pkg build automation

Context: Fixes an issue?

Improves the process for signing the releases for macOS and potentially submitting them automatically to the App Store.

Does this change need documentation? What needs to be documented and how?

Required:

  1. In Apple Developer Account, create the following resources in in https://developer.apple.com/account/resources/certificates/list
  • Certificates:

    • Mac Installer Distribution
    • Mac App Distribution
  • Identifier:

    • app ID (bundleID)
  1. Add the certs to Github Secrets as per https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development

Status of this Pull Request
Brought up to date with the current main branch. Build works.

What is missing until this pull request can be merged?
Needs to be tested as-is with a release (e.g. nightly?), and in the future with suitable signing certificates for both notarization and App Store submission.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

This commit combines all the changes made by Dan G into one.
@softins softins added the tooling Changes to the automated build system label Jul 11, 2024
@softins softins requested a review from ann0see July 11, 2024 13:54
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${KEYCHAIN_PASSWORD}" build.keychain
security import macos_certificate.p12 -k build.keychain -P "${MACOS_CERTIFICATE_PWD}" -A -T /usr/bin/codesign
security import macapp_certificate.p12 -k build.keychain -P "${MAC_STORE_APP_CERT_PWD}" -A -T /usr/bin/codesign
security import macinst_certificate.p12 -k build.keychain -P "${MAC_STORE_INST_CERT_PWD}" -A -T /usr/bin/productbuild
Copy link
Member

Choose a reason for hiding this comment

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

Is this ok even if no macinst_certificate or macapp_certificate exists?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm just looking through the logic. I suspect we need to add some checks to allow signing without app store submission. At the moment it appears that signing will be skipped if the app store certificates are not also available. I'll raise a comment at the relevant place.

@ann0see
Copy link
Member

ann0see commented Jul 11, 2024

Otherwise: If it builds, we can merge this.

@ann0see ann0see added this to the Release 3.11.0 milestone Jul 11, 2024
@ann0see ann0see mentioned this pull request Jul 11, 2024
60 tasks
Comment on lines 79 to 92
[[ "${SIGN_IF_POSSIBLE:-0}" == "1" ]] || return 1

# Signing was requested, now check all prerequisites:
[[ -n "${MACOS_CERTIFICATE:-}" ]] || return 1
[[ -n "${MACOS_CERTIFICATE_ID:-}" ]] || return 1
[[ -n "${MACOS_CERTIFICATE_PWD:-}" ]] || return 1
[[ -n "${MAC_STORE_APP_CERT:-}" ]] || return 1
[[ -n "${MAC_STORE_APP_CERT_ID:-}" ]] || return 1
[[ -n "${MAC_STORE_APP_CERT_PWD:-}" ]] || return 1
[[ -n "${MAC_STORE_INST_CERT:-}" ]] || return 1
[[ -n "${MAC_STORE_INST_CERT_ID:-}" ]] || return 1
[[ -n "${MAC_STORE_INST_CERT_PWD:-}" ]] || return 1
[[ -n "${NOTARIZATION_PASSWORD:-}" ]] || return 1
[[ -n "${KEYCHAIN_PASSWORD:-}" ]] || return 1
Copy link
Member Author

Choose a reason for hiding this comment

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

This suggests that signing will be aborted if we do not also have certificates for app store submission. We need a way to allow just signing without store submission.

@softins
Copy link
Member Author

softins commented Jul 13, 2024

Setting this one to draft while @danryu works on the original PR #2624

@softins softins marked this pull request as draft July 13, 2024 21:52
@softins
Copy link
Member Author

softins commented Jul 20, 2024

Closing this in favour of #2624, which is now up to date.

@softins softins closed this Jul 20, 2024
@pljones pljones removed this from the Release 3.11.0 milestone Jul 21, 2024
@softins softins deleted the macos-sign-squash branch August 7, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Changes to the automated build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants