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
Non-wildcard/strict matching provisioning profiles have higher priority than wildcard profiles.
The more specific the bundle identifier is, the higher the priority. For example
com.example.app.extension is more specific than com.example.app and
com.example.app.* is more specific than com.example.*, which is more specific than just *.
Provisioning profiles with the same level of namespacing (number of dots in bundle identifier) are order alphabetically by comparing bundle identifier values.
Finally in case of bundle identifiers are the same, more recently generated provisioning profile comes first.
For example this is how those provisioning profiles would be ordered.
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 scriptcode_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 thatcom.example.app.extension
is more specific thancom.example.app
andcom.example.app.*
is more specific thancom.example.*
, which is more specific than just*
.For example this is how those provisioning profiles would be ordered.
io.codemagic.banaan.UITests.xctrunner
io.codemagic.banaan.Clip
io.codemagic.banaan
io.codemagic.capybara
io.codemagic.*
io.codemagic.*
*
*
Updated actions:
xcode-project use-profiles