Up until this point I have been manually archiving and publishing to TestFlight. This wouldn't be an issue except when I include arm7 as a supported arch type, my archival time takes a giant leap from around 90 seconds (only targeting arm64) to 45-50 minutes. Some of my testers are still using 32 bit devices, (iPad 4, iPhone 5), so removing arm7 from my supported arch types isn't an option. I am therefore looking to integrate Xcode Server into my workflow so I can continue development as the server archives my latest commit.
This brings me to my question: what steps are involved in setting up Xcode Server to create an archive and upload to TestFlight (preferably automatically on pushing to my GitHub repo)?
The steps I have taken so far are:
- Set up Xcode Server
- Create Bot
- Re-enter my GitHub username/password (I get an Authentication failed because they are missing?)
- Select the remote branch
- Select Archive (Installable products and thinned variants) and set the configuration to Release
- Integrate (on commit) and clean build always
- Build for iOS devices
- Check the allow Xcode Server to manage my certificates and automatically add devices to my developer account.
- Add server to team (for some reason it keeps getting removed every time I go through these steps)
- The following two pages I've so far left blank.
The result of this workflow is a red exclamation next to my server name, with no bots listed underneath it. If I go through the Create Bot wizard again, I need to re-enter my GitHub details, and re-add Xcode Server to my team.
As for uploading the resultant archive, altool appears to be what I need (here). For the time being though I'd be happy if I could get a bot to create the archive and for me to manually upload to TestFlight.
As far as server setup take a look at the articles Honza Dvorsky wrote a while back. Things have changed in Xcode since 2015 but the basic idea is still the same you just do it inside Xcode rather than Server.app now.
Then take a look at fastlane. You can create a lane that creates an archive and uploads it to TestFlight (along with anything else you want it to do). You can then create a post integration trigger that runs on success and triggers the lane.