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

Feature: Use "Distribution" certificate for iOS App AdHoc profiles #198

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
UNRELEASED
-------------

**Features**
- Change default behaviour for resolving certificate type from provisioning profile type. Map `IOS_APP_ADHOC` provisioning profile type to `DISTRIBUTION` certificate type instead of `IOS_DISTRIBUTION`. "Apple Distribution" certificates can be used to sign any type of application (iOS, tvOS, Mac, Universal, etc.) and as a result fewer certificates are required. Applies to the following actions:
- `app-store-connect fetch-signing-files`,
- `app-store-connect list-certificates`.

This change is backwards compatible in the sense that existing matching `IOS_DISTRIBUTION` certificates are still used for `IOS_APP_ADHOC` provisioning profiles if found. [PR #198](https://github.com/codemagic-ci-cd/cli-tools/pull/198)

**Development**
- Behaviour of `CertificateType.from_profile_type` was changed:
- calling it with `ProfileType.IOS_APP_STORE` returns `CertificateType.DISTRIBUTION` instead of `CertificateType.IOS_DISTRIBUTION` as before. [PR #198](https://github.com/codemagic-ci-cd/cli-tools/pull/198)

Version 0.17.2
-------------

Expand Down
2 changes: 1 addition & 1 deletion src/codemagic/apple/resources/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class CertificateType(ResourceEnum):
@classmethod
def from_profile_type(cls, profile_type: ProfileType) -> CertificateType:
if profile_type is profile_type.IOS_APP_ADHOC:
return CertificateType.IOS_DISTRIBUTION
return CertificateType.DISTRIBUTION
elif profile_type is profile_type.IOS_APP_DEVELOPMENT:
return CertificateType.IOS_DEVELOPMENT
elif profile_type is profile_type.IOS_APP_STORE:
Expand Down
4 changes: 4 additions & 0 deletions src/codemagic/tools/app_store_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ def _resolve_certificate_types(
# certificates and consequently they too can be used with those profiles.
if profile_type is ProfileType.IOS_APP_STORE:
types.add(CertificateType.IOS_DISTRIBUTION)
elif profile_type is ProfileType.IOS_APP_ADHOC:
types.add(CertificateType.IOS_DISTRIBUTION)
elif profile_type is ProfileType.MAC_APP_STORE:
types.add(CertificateType.MAC_APP_DISTRIBUTION)

Expand Down Expand Up @@ -793,6 +795,8 @@ def _get_or_create_certificates(self,
# certificates, and we want to keep using existing certificates for as long as possible.
if profile_type is ProfileType.IOS_APP_STORE:
certificate_types.append(CertificateType.IOS_DISTRIBUTION)
elif profile_type is ProfileType.IOS_APP_ADHOC:
certificate_types.append(CertificateType.IOS_DISTRIBUTION)
elif profile_type is ProfileType.MAC_APP_STORE:
certificate_types.append(CertificateType.MAC_APP_DISTRIBUTION)

Expand Down