diff --git a/CHANGELOG.md b/CHANGELOG.md index 994022737..6cf2f8e76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +Version 0.64.0 +------------- + +This release contains changes from [PR #489](https://github.com/codemagic-ci-cd/cli-tools/pull/489). + +**Features** +- Update default argument values for tool `app-store-connect` to be consistent with Xcode 16.0+. This changes where downloaded signing files are saved by default. + - Argument `--certificates-dir` defaults now to `~/Library/Developer/Xcode/UserData/Certificates`. + - Argument `--profiles-dir` defaults now to `~/Library/Developer/Xcode/UserData/Provisioning Profiles`. +- Update action `keychain add-certificates` argument `--certificate` to look up certificates from `~/Library/Developer/Xcode/UserData/Certificates`. Old certificates location remains also included in the default glob patterns. +- Update action `xcode-project use-profiles` argument `--profile` to look up provisioning profiles from `~/Library/Developer/Xcode/UserData/Provisioning Profiles.` by default. Old certificates location remains also included in the default glob patterns. + +**Docs** +- Update docs for `app-store-connect`. +- Update docs for `keychain add-certificates`. +- Update docs for `xcode-project use-profiles`. + Version 0.63.0 ------------- diff --git a/pyproject.toml b/pyproject.toml index 9459c2628..7cf49a09e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "codemagic-cli-tools" -version = "0.63.0" +version = "0.64.0" description = "CLI tools used in Codemagic builds" authors = [{ name = "Priit Lätt", email = "priit@nevercode.io" }] requires-python = ">=3.8,<4" diff --git a/src/codemagic/__version__.py b/src/codemagic/__version__.py index 1b0f47c26..b73c8e221 100644 --- a/src/codemagic/__version__.py +++ b/src/codemagic/__version__.py @@ -1,5 +1,5 @@ __title__ = "codemagic-cli-tools" __description__ = "CLI tools used in Codemagic builds" -__version__ = "0.63.0.dev" +__version__ = "0.64.0.dev" __url__ = "https://github.com/codemagic-ci-cd/cli-tools" __licence__ = "GNU General Public License v3.0" diff --git a/src/codemagic/models/certificate.py b/src/codemagic/models/certificate.py index e716298b7..8c51cd032 100644 --- a/src/codemagic/models/certificate.py +++ b/src/codemagic/models/certificate.py @@ -39,7 +39,10 @@ class Certificate(JsonSerializable, RunningCliAppMixin, StringConverterMixin): - DEFAULT_LOCATION = pathlib.Path(pathlib.Path.home(), "Library", "MobileDevice", "Certificates") + # This location is not generally recognized by Apple in any way. Just keep it in sync with + # the provisioning profiles directory. + DEFAULT_LOCATION = pathlib.Path.home() / "Library" / "Developer" / "Xcode" / "UserData" / "Certificates" + LEGACY_LOCATION = pathlib.Path.home() / "Library" / "MobileDevice" / "Certificates" def __init__(self, certificate: x509.Certificate): if hasattr(certificate, "to_cryptography"): diff --git a/src/codemagic/models/provisioning_profile.py b/src/codemagic/models/provisioning_profile.py index c7182d8e9..031b09e8a 100644 --- a/src/codemagic/models/provisioning_profile.py +++ b/src/codemagic/models/provisioning_profile.py @@ -23,7 +23,12 @@ class ProvisioningProfile(JsonSerializable, RunningCliAppMixin, StringConverterMixin): - DEFAULT_LOCATION = pathlib.Path(pathlib.Path.home(), "Library", "MobileDevice", "Provisioning Profiles") + # Xcode versions up to 15.x expected profiles to be stored in '~/Library/MobileDevice/Provisioning Profiles'. + # This is also where Xcode's auto-managed profiles were put. Since Xcode 16.0 profiles are stored in + # '~/Library/Developer/Xcode/UserData/Provisioning Profiles' instead. Keep a reference to the old location + # for backwards compatibility. + DEFAULT_LOCATION = pathlib.Path.home() / "Library" / "Developer" / "Xcode" / "UserData" / "Provisioning Profiles" + LEGACY_LOCATION = pathlib.Path.home() / "Library" / "MobileDevice" / "Provisioning Profiles" def __init__(self, plist: Dict[str, Any]): self._plist = plist diff --git a/src/codemagic/tools/_xcode_project/arguments.py b/src/codemagic/tools/_xcode_project/arguments.py index 965e07282..56ff6d384 100644 --- a/src/codemagic/tools/_xcode_project/arguments.py +++ b/src/codemagic/tools/_xcode_project/arguments.py @@ -134,6 +134,8 @@ class XcodeProjectArgument(cli.Argument): "default": ( ProvisioningProfile.DEFAULT_LOCATION / "*.mobileprovision", ProvisioningProfile.DEFAULT_LOCATION / "*.provisionprofile", + ProvisioningProfile.LEGACY_LOCATION / "*.mobileprovision", + ProvisioningProfile.LEGACY_LOCATION / "*.provisionprofile", ), }, ) diff --git a/src/codemagic/tools/app_store_connect/arguments.py b/src/codemagic/tools/app_store_connect/arguments.py index 5b30ea539..3f89f5633 100644 --- a/src/codemagic/tools/app_store_connect/arguments.py +++ b/src/codemagic/tools/app_store_connect/arguments.py @@ -522,14 +522,20 @@ class AppStoreConnectArgument(cli.Argument): flags=("--certificates-dir",), type=pathlib.Path, description="Directory where the code signing certificates will be saved", - argparse_kwargs={"required": False, "default": Certificate.DEFAULT_LOCATION}, + argparse_kwargs={ + "required": False, + "default": Certificate.DEFAULT_LOCATION, + }, ) PROFILES_DIRECTORY = cli.ArgumentProperties( key="profiles_directory", flags=("--profiles-dir",), type=pathlib.Path, description="Directory where the provisioning profiles will be saved", - argparse_kwargs={"required": False, "default": ProvisioningProfile.DEFAULT_LOCATION}, + argparse_kwargs={ + "required": False, + "default": ProvisioningProfile.DEFAULT_LOCATION, + }, ) diff --git a/src/codemagic/tools/keychain.py b/src/codemagic/tools/keychain.py index 665b2876c..f4752255b 100755 --- a/src/codemagic/tools/keychain.py +++ b/src/codemagic/tools/keychain.py @@ -74,7 +74,10 @@ class KeychainArgument(cli.Argument): "required": False, "nargs": "+", "metavar": "certificate-path", - "default": (Certificate.DEFAULT_LOCATION / "*.p12",), + "default": ( + Certificate.DEFAULT_LOCATION / "*.p12", + Certificate.LEGACY_LOCATION / "*.p12", + ), }, ) CERTIFICATE_PASSWORD = cli.ArgumentProperties(