Xcode Archive tagging is created in Git or another SCM

I want my Xcode Archive to automatically label my SCM (Git in this project).

I noticed that in the schematic editor, Archival assemblies can run scripts for preliminary and step-by-step assemblies . It would be ideal if the post-steps are performed only if the assembly was successful, and then the tag can get there.

I would like the tag name to refer to the assembly configuration name (I have the TestFlight and AppStore configurations, as well as Debug and Release, which are usually not archived), as well as the version number that was and also the assembly number. The tag may look something like this: TestFlight_2.1.3_#11 or AppStore_2.9.0_#3 .

In your Xcode project settings, you can use variable substitutions such as $(BUILD_CONFIGURATION) . Can they be used in building a script archive?

I am also not sure if there is a variable for the current version line and the build number of the application. I could not find him if he is.

+1
source share
2 answers

In your Xcode project settings, you can use variable substitutions such as $ (BUILD_CONFIGURATION). Can they be used in building a script archive?

Yes. Build options are available as environment variables for scripts that run as part of Run Script Build Phase. An easy way to see which variables are set (if you do not believe in the output of the build log), just put env in Script to print them, or env > environment.txt if you want to save them to a file.

I am also not sure if there is a variable for the current version and the build number of the application. I could not find him if he is.

Not. However, if you want to get the current version, you can get it from the project's Info.plist file (and there must be an environment variable pointing to the file for the active project).

Xcode Archive has no idea of ​​the current build number. Usually you use Script to determine the build number from some other source (Xcode Server, counter on your disk, etc.), and then set this CFBundleVersion key in Info.plist to this number.

+1
source

I found this: https://github.com/bejo/XcodeIconTagger

Obviously, this is not exactly what you requested, as this will mark the icon, but you can probably use it to point you in the right direction.

0
source

All Articles