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

Support App Store Connect API keys and provisioning profiles #75

Merged
merged 8 commits into from
Feb 13, 2022

Conversation

chris-araman
Copy link
Collaborator

@chris-araman chris-araman commented Dec 30, 2021

Closes #71.

Using an App Store Connect API key with Xcode >= 13 allows automatic device registration, certificate creation, and provisioning profile creation.

Users who want to use an existing provisioning profile, or who use Xcode < 13, can now pass a list of Base64-encoded Mac or iOS provisioning profiles.

@chris-araman

This comment has been minimized.

@chris-araman chris-araman marked this pull request as draft January 5, 2022 01:19
@chris-araman chris-araman changed the title Support App Store Connect API keys Support App Store Connect API keys and provisioning profiles Jan 5, 2022
@chris-araman chris-araman marked this pull request as ready for review January 5, 2022 01:36
@chris-araman chris-araman marked this pull request as draft January 5, 2022 01:49
@chris-araman
Copy link
Collaborator Author

❌  error: Revoke certificate: Your account already has an Apple Development signing certificate for this machine, but its private key is not installed in your keychain. Xcode can create a new one after revoking your existing certificate

Looks like I may need to make use of actions/cache.

@mxcl
Copy link
Owner

mxcl commented Jan 5, 2022

We should bump to v2 since we are removing code-sign-certificate.

Unless we can reasonably prove this only effects <2 projects. (Not sure we can prove anything).

@chris-araman
Copy link
Collaborator Author

chris-araman commented Jan 5, 2022

I'm not planning to remove any inputs. I reorganized the README section on code signing a bit:

  • App Store Connect API key: Requires Xcode 13. Manages device registration, certificates and provisioning profiles automatically.
  • Certificates: Installs a specific certificate to the macOS Keychain.
  • Provisioning Profiles: Installs specific provisioning profiles.

None of these should be mutually exclusive, in theory. The simplest usage for most users should be the API key alone.

To Do:

  • Figure out how to address the private key is not installed error.
    • We could find a way to persist the certificate for a given GitHub Actions host (macOS Device UUID), perhaps using @actions/cache. What are the security implications of that?
    • Alternatively, we could call the App Store Connect API directly to revoke the existing certificate beforehand. This might have the effect of generating a long list of revoked certs on the developer's account.
    • Failing those ideas, maybe this is only useful for GHES and self-hosted runners? That would be disappointing.
  • Determine whether installing a Mac .provisionprofile is useful, or if only iOS-ish .mobileprovision profiles are useful. It's not clear to me, for instance, if a provisioning profile from a developer's Mac is meant to (or can) be copied to another Mac and remain useful. Mobile profiles clearly seem useful, as there are dozens of projects copying them around, and GitHub documents how to install them.
    • Perhaps a .provisionprofile is only useful for Mac Catalyst development? I that's the case, I'll document it as such.

src/index.ts Outdated Show resolved Hide resolved
Copy link
Owner

@mxcl mxcl left a comment

Choose a reason for hiding this comment

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

Safely additive.

@chris-araman
Copy link
Collaborator Author

Sorry for the delay. It's been, uh, an unexpectedly busy few weeks. 😅

Still investigating the To Dos above.

@mxcl
Copy link
Owner

mxcl commented Jan 28, 2022

nps dude; to me you’re an open source king 👑

@chris-araman
Copy link
Collaborator Author

I think I've convinced myself that the propagation of provisioning profiles is generally useful.

Unfortunately, I think the App Store Connect API functionality is only useful for self-hosted runners, where private keys persist. Would you be comfortable accepting this PR in order to support the functionality only for self-hosted runners?

Support for GitHub-hosted runners could be added in a later PR by persisting any private keys installed using the App Store Connect API. I want to err on the side of incremental progress, and I worry about letting this PR die on the vine.

@chris-araman chris-araman marked this pull request as ready for review February 12, 2022 06:07
@mxcl
Copy link
Owner

mxcl commented Feb 12, 2022

Possibly the private key could be written to the repo as a secret?

Either way that can happen later. It’s fine that this only works for private runners provided we document it as such.

@chris-araman
Copy link
Collaborator Author

Sounds good. I'll add some clarifying documentation to the README and YAML, then merge. Probably tonight or tomorrow. I can (minor) release, too, if you like.

@chris-araman
Copy link
Collaborator Author

Possibly the private key could be written to the repo as a secret?

Ooh, that's a neat tack. I think it'd still be one private key per Device UUID, but that could be included in the secret name.

@mxcl
Copy link
Owner

mxcl commented Feb 12, 2022

Yep please bump too!

@chris-araman chris-araman merged commit 42f62f3 into master Feb 13, 2022
@chris-araman chris-araman deleted the api branch February 13, 2022 19:34
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.

Support App Store Connect API Keys with Xcode >= 13
2 participants