Building iOS apps with GitHub Workflows
GitHub Workflows can be executed on macOS runners, which are capabale of building iOS apps. This guide will provide an overview on how to build an iOS app with GitHub Workflows.
Apple certificates and provisioning profiles
To get started, follow the GitHub docs for installing an Apple certificate and provisiniong profile on macOS runners for Xcode development.
XCode version
The macOS runners come with an XCode version pre-installed. This can be switched to another version listed in the relevant runners README.
For example, the macos-12
runner provides several XCode versions ranging from 13.1
- 14.2
.
xcodebuild
Now you can build your iOS app with xcodebuild
. The exact command will vary depending on your version and project.
The following are examples to archive and export an iOS app.
# Archive a project
xcodebuild -project "./ProjectName.xcodeproj" -scheme "ProjectName" -archivePath "./archives/archive.xcarchive" archive -destination "generic/platform=iOS"
# Archive a workspace
xcodebuild -workspace "./ProjectName.xcworkspace" -scheme "ProjectName" -archivePath "./archives/archive.xcarchive" archive -destination "generic/platform=iOS"
# Export an archive to an IPA file
xcodebuild -exportArchive -archivePath "./archives/archive.xcarchive" -exportPath "./output" -exportOptionsPlist ./export.plist