codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
261 stars 42 forks source link

Bugfix: Do not rely on provisioning profile ordering on disk for `xcode-project use-profiles` #308

Closed priitlatt closed 1 year ago

priitlatt commented 1 year ago

Two invocations of xcode-project use-profiles can lead to different modifications to Xcode project files even though the very same set of provisioning profiles are discovered. This can happen because the script code_signing_manager.rb, which is used internally for updating *.xcodeproj files, depends on the order of provisioning profiles that are passed to it.

In order to avoid such inconsistencies, make sure that profiles are sorted in a stable manner before serializing them for code_signing_manager.rb. The changes in this PR ensure that profiles are ordered so that

For example this is how those provisioning profiles would be ordered.

Bundle identifier Created at
io.codemagic.banaan.UITests.xctrunner 2023-01-20 13:17:03
io.codemagic.banaan.Clip 2023-01-20 13:17:03
io.codemagic.banaan 2023-01-20 13:17:02
io.codemagic.capybara 2023-01-20 13:29:58
io.codemagic.* 2022-09-28 10:40:41
io.codemagic.* 2022-03-24 10:02:42
* 2023-02-02 13:14:11
* 2022-11-14 10:15:54

Updated actions: