@@ -142,7 +142,8 @@ if you think we could have figured it out but didn’t please open a ticket.
142142
143143GitHub’s images have a **limited selection** of Xcodes.
144144
145- - GitHub list what is available for the current 10.15 image [here][gha-xcode-list].
145+ - GitHub list what is available for the current [10.15][gha-xcode-list-catalina]
146+ and [11][gha-xcode-list-big-sur] images.
146147- We run a scheduled workflow to determine what is available [here][automated-list].
147148
148149To install other versions first use [sinoru/actions-setup-xcode], then
@@ -174,31 +175,105 @@ This behavior cannot currently be disabled, PR welcome.
174175
175176# # Code Signing
176177
178+ > This feature requires macOS.
179+
180+ Code signing can be enabled with either an App Store Connect API key, or with a
181+ certificate.
182+
183+ # ## Using an App Store Connect API Key
184+
185+ > This feature requires Xcode 13 or later.
186+
187+ [Create][create-api-key-instructions] an API key on
188+ [App Store Connect][create-api-key]. Download your key and Base64-encode it :
189+
190+ ` ` ` bash
191+ base64 AuthKey_9XXXX9XXXX.p8
192+ ` ` `
193+
194+ Create [GitHub Secrets][secrets] for your base64-encoded key, the key ID, and
195+ the key's issuer ID. The IDs are displayed on App Store Connect.
196+
177197` ` ` yaml
178198jobs:
179199 build:
180200 runs-on: macos-latest
181201 steps:
182202 - use: mxcl/xcodebuild@v1
183203 with:
184- code-sign-certificate: ${{ secrets.CERTIFICATE_BASE64 }}
185- code-sign-certificate-passphrase: ${{ secrets.CERTIFICATE_PASSPHRASE}}
204+ authentication-key-base64: ${{ secrets.APP_STORE_CONNECT_KEY_BASE64 }}
205+ authentication-key-id: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
206+ authentication-key-issuer-id: ${{ secrets.APP_STORE_CONNECT_KEY_ISSER_ID }}
186207` ` `
187208
188- > This feature requires macOS.
209+ Certificates and provisioning profiles will be created automatically using the
210+ App Store Connect API. Certificates will appear in your
211+ [list of certificates](cert-list) as `Created via API`.
212+
213+ Devices will be registered automatically. GitHub-hosted runners will appear in
214+ in your [list of devices](device-list) as `mac-NUMBER.local`.
215+
216+ > :warning: This may cause undesired behavior when using GitHub-hosted runners.
217+ > For best results, use App Store Connect API keys only on self-hosted runners.
218+
219+ For more information on this method of code signing, please review the
220+ ["Distribute apps in Xcode with cloud signing"][cloud-signing] talk from WWDC21.
221+
222+ # ## Using a Specific Certificate
189223
190- A code signing certificate can be installed to the macOS Keychain. It is
191- automatically removed from the Keychain in a post action.
224+ If you are not able to use an App Store Connect API key, and you have a specific
225+ code signing certificate you'd like to use, it can be installed to the macOS
226+ Keychain. It is automatically removed from the Keychain in a post action.
227+
228+ ` ` ` yaml
229+ jobs:
230+ build:
231+ runs-on: macos-latest
232+ steps:
233+ - use: mxcl/xcodebuild@v1
234+ with:
235+ code-sign-certificate: ${{ secrets.CERTIFICATE_BASE64 }}
236+ code-sign-certificate-passphrase: ${{ secrets.CERTIFICATE_PASSPHRASE}}
237+ ` ` `
192238
193239To export your certificate from Xcode and Base64 encode it, follow
194240[these instructions][export]. Store any secrets, including certificates and
195241passphrases, in GitHub as [Encrypted Secrets][secrets].
196242
243+ # ## Specifying an Identity
244+
197245You may specify a `code-sign-identity` to override any `CODE_SIGN_IDENTITY`
198246specified by your project.
199247
248+ # ## Disabling Code Signing
249+
200250To disable code signing, you can specify `code-sign-identity : ' -' ` .
201251
252+ ### Provisioning Profiles
253+
254+ If you are not able to use an App Store Connect API key, and you have specific
255+ provisioning profiles you'd like to use, you can specify profiles for Mac
256+ ` provisioning-profiles-base64`, or for iOS or other devices using
257+ ` mobile-provisioning-profiles-base64` .
258+
259+ To export your provisioning profiles from Xcode and Base64 encode these, follow
260+ [these instructions][export]. Store any secrets, including provisioning
261+ profiles, in GitHub as [Encrypted Secrets][secrets].
262+
263+ ` ` ` yaml
264+ jobs:
265+ build:
266+ runs-on: macos-latest
267+ steps:
268+ - use: mxcl/xcodebuild@v1
269+ with:
270+ mobile-provisioning-profiles-base64: |
271+ ${{ secrets.IPHONE_PROVISIONING_PROFILE_BASE64 }}
272+ ${{ secrets.IPAD_PROVISIONING_PROFILE_BASE64 }}
273+ provisioning-profiles-base64: |
274+ ${{ secrets.MAC_PROVISIONING_PROFILE_BASE64 }}
275+ ` ` `
276+
202277# # Caveats
203278
204279- The selected Xcode remains the default Xcode for the image for the duration of
@@ -265,7 +340,13 @@ This action does not support Windows.
2653401. Create a [Pull Request](https://github.com/mxcl/xcodebuild/compare)
266341
267342[automated-list] : https://flatgithub.com/mxcl/.github/?filename=versions.json
268- [gha-xcode-list] : https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode
343+ [cloud-signing] : https://developer.apple.com/videos/play/wwdc2021/10204/
344+ [create-api-key] : https://appstoreconnect.apple.com/access/api
345+ [create-api-key-instructions] : https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
346+ [cert-list] : https://developer.apple.com/account/resources/certificates/list
347+ [device-list] : https://developer.apple.com/account/resources/devices/list
348+ [gha-xcode-list-catalina] : https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode
349+ [gha-xcode-list-big-sur] : https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode
269350[sinoru/actions-setup-xcode] : https://github.com/sinoru/actions-setup-xcode
270351[img] : https://raw.githubusercontent.com/mxcl/xcodebuild/gh-pages/XCResult.png
271352[secrets] : https://docs.github.com/en/actions/reference/encrypted-secrets
0 commit comments