- For CI/CD we are using Xcode Cloud.
- My application have three build configurations: Debug, Stage and Release.
- In the Xcode Cloud we have set up two pipelines: Stage and Release.
- Default build configuration for archive state is Release. Image attached
When we are triggering Stage pipeline it executes archive with Release configuration. Here is no the way to set build configuration for pipeline.
How to change active build configuration in Xcode Cloud pipeline?
2
Answers
One thing you can do is to create another scheme, like BSG-Stage and set the build configuration of it to Stage (instead of release).
Then you can add a separate workflow in XCode cloud for the staging and select the "BSG-Stage" scheme.
XCode cloud allows you to have scripts running before doing the actual compilation.
In either
ci_post_clone.sh
orci_pre_xcodebuild.sh
it should be possible to do a simple modification of the scheme you are building to have a different default build config.Something like this:
CHOSEN_CONFIG
can be set as an environment variable in the XCode cloud workflow, so you can just create one workflow per desired build config type.Note: this is hackish, prone to be broken at any time. You could parse the xml scheme file and modify the specific
buildConfiguration
you need, but even that could be broken in the future. Hopefully Apple will expose an official way to change the config soon.