-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathstep.yml
516 lines (431 loc) · 23.5 KB
/
step.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
title: Xcode Archive & Export for iOS
summary: Automatically manages your code signing assets, archives and exports an .ipa in one Step.
description: |-
The Step archives your Xcode project by running the `xcodebuild archive` command and then exports the archive into an .ipa file with the `xcodebuild -exportArchive` command.
This .ipa file can be shared, installed on test devices, or uploaded to the App Store Connect.
With this Step, you can use automatic code signing in a [CI environment without having to use Xcode](https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes).
In short, the Step:
- Logs you into your Apple Developer account based on the [Apple service connection you provide on Bitrise](https://devcenter.bitrise.io/en/accounts/connecting-to-services/apple-services-connection.html).
- Downloads any provisioning profiles needed for your project based on the **Distribution method**.
- Runs your build. It archives your Xcode project by running the `xcodebuild archive` command and exports the archive into an .ipa file with the `xcodebuild -exportArchive` command.
This .ipa file can be shared and installed on test devices, or uploaded to App Store Connect.
### Configuring the Step
Before you start:
- Make sure you have connected your [Apple Service account to Bitrise](https://devcenter.bitrise.io/en/accounts/connecting-to-services/apple-services-connection.html).
Alternatively, you can upload certificates and profiles to Bitrise manually, then use the Certificate and Profile installer step before Xcode Archive
- Make sure certificates are uploaded to Bitrise's **Code Signing** tab. The right provisioning profiles are automatically downloaded from Apple as part of the automatic code signing process.
To configure the Step:
1. **Project path**: Add the path where the Xcode Project or Workspace is located.
2. **Scheme**: Add the scheme name you wish to archive your project later.
3. **Distribution method**: Select the method Xcode should sign your project: development, app-store, ad-hoc, or enterprise.
Under **xcodebuild configuration**:
1. **Build configuration**: Specify Xcode Build Configuration. The Step uses the provided Build Configuration's Build Settings to understand your project's code signing configuration. If not provided, the Archive action's default Build Configuration will be used.
2. **Build settings (xcconfig)**: Build settings to override the project's build settings. Can be the contents, file path or empty.
3. **Perform clean action**: If this input is set, a `clean` xcodebuild action will be performed besides the `archive` action.
Under **Xcode build log formatting**:
1. **Log formatter**: Defines how `xcodebuild` command's log is formatted. Available options are `xcpretty`: The xcodebuild command's output will be prettified by xcpretty. `xcodebuild`: Only the last 20 lines of raw xcodebuild output will be visible in the build log.
The raw xcodebuild log is exported in both cases.
Under **Automatic code signing**:
1. **Automatic code signing method**: Select the Apple service connection you want to use for code signing. Available options: `off` if you don't do automatic code signing, `api-key` [if you use API key authorization](https://devcenter.bitrise.io/en/accounts/connecting-to-services/connecting-to-an-apple-service-with-api-key.html), and `apple-id` [if you use Apple ID authorization](https://devcenter.bitrise.io/en/accounts/connecting-to-services/connecting-to-an-apple-service-with-apple-id.html).
2. **Register test devices on the Apple Developer Portal**: If this input is set, the Step will register the known test devices on Bitrise from team members with the Apple Developer Portal. Note that setting this to `yes` may cause devices to be registered against your limited quantity of test devices in the Apple Developer Portal, which can only be removed once annually during your renewal window.
3. **The minimum days the Provisioning Profile should be valid**: If this input is set to >0, the managed Provisioning Profile will be renewed if it expires within the configured number of days. Otherwise the Step renews the managed Provisioning Profile if it is expired.
4. The **Code signing certificate URL**, the **Code signing certificate passphrase**, the **Keychain path**, and the **Keychain password** inputs are automatically populated if certificates are uploaded to Bitrise's **Code Signing** tab. If you store your files in a private repo, you can manually edit these fields.
If you want to set the Apple service connection credentials on the step-level (instead of using the one configured in the App Settings), use the Step inputs in the **App Store Connect connection override** category. Note that this only works if **Automatic code signing method** is set to `api-key`.
Under **IPA export configuration**:
1. **Developer Portal team**: Add the Developer Portal team's name to use for this export. This input defaults to the team used to build the archive.
2. **Rebuild from bitcode**: For non-App Store exports, should Xcode re-compile the app from bitcode?
3. **Include bitcode**: For App Store exports, should the package include bitcode?
4. **iCloud container environment**: If the app is using CloudKit, this input configures the `com.apple.developer.icloud-container-environment` entitlement. Available options vary depending on the type of provisioning profile used, but may include: `Development` and `Production`.
5. **Export options plist content**: Specifies a `plist` file content that configures archive exporting. If not specified, the Step will auto-generate it.
Under **Step Output Export configuration**:
1. **Output directory path**: This directory will contain the generated artifacts.
2. **Export all dSYMs**: Export additional dSYM files besides the app dSYM file for Frameworks.
3. **Override generated artifact names**: This name is used as basename for the generated Xcode archive, app, `.ipa` and dSYM files. If not specified, the Product Name (`PRODUCT_NAME`) Build settings value will be used. If Product Name is not specified, the Scheme will be used.
Under **Caching**:
1. **Enable collecting cache content**: Defines what cache content should be automatically collected. Available options are `none`: Disable collecting cache content and `swift_packages`: Collect Swift PM packages added to the Xcode project
Under Debugging:
1. **Verbose logging***: You can set this input to `yes` to produce more informative logs.
website: https://github.com/bitrise-steplib/steps-xcode-archive
source_code_url: https://github.com/bitrise-steplib/steps-xcode-archive
support_url: https://github.com/bitrise-steplib/steps-xcode-archive/issues
project_type_tags:
- ios
- react-native
- flutter
type_tags:
- build
is_always_run: false
is_skippable: false
toolkit:
go:
package_name: github.com/bitrise-steplib/steps-xcode-archive
inputs:
- project_path: $BITRISE_PROJECT_PATH
opts:
title: Project path
summary: Xcode Project (`.xcodeproj`) or Workspace (`.xcworkspace`) path.
description: |-
Xcode Project (`.xcodeproj`) or Workspace (`.xcworkspace`) path.
The input value sets xcodebuild's `-project` or `-workspace` option.
is_required: true
- scheme: $BITRISE_SCHEME
opts:
title: Scheme
summary: Xcode Scheme name.
description: |-
Xcode Scheme name.
The input value sets xcodebuild's `-scheme` option.
is_required: true
- distribution_method: development
opts:
title: Distribution method
summary: Describes how Xcode should export the archive.
value_options:
- development
- app-store
- ad-hoc
- enterprise
is_required: true
# xcodebuild configuration
- configuration:
opts:
category: xcodebuild configuration
title: Build Configuration
summary: Xcode Build Configuration.
description: |-
Xcode Build Configuration.
If not specified, the default Build Configuration will be used.
The input value sets xcodebuild's `-configuration` option.
- xcconfig_content: COMPILER_INDEX_STORE_ENABLE = NO
opts:
category: xcodebuild configuration
title: Build settings (xcconfig)
summary: Build settings to override the project's build settings, using xcodebuild's `-xcconfig` option.
description: |-
Build settings to override the project's build settings, using xcodebuild's `-xcconfig` option.
You can't define `-xcconfig` option in `Additional options for the xcodebuild command` if this input is set.
If empty, no setting is changed. When set it can be either:
1. Existing `.xcconfig` file path.
Example:
`./ios-sample/ios-sample/Configurations/Dev.xcconfig`
2. The contents of a newly created temporary `.xcconfig` file. (This is the default.)
Build settings must be separated by newline character (`\n`).
Example:
```
COMPILER_INDEX_STORE_ENABLE = NO
ONLY_ACTIVE_ARCH[config=Debug][sdk=*][arch=*] = YES
```
- perform_clean_action: "no"
opts:
category: xcodebuild configuration
title: Perform clean action
summary: If this input is set, `clean` xcodebuild action will be performed besides the `archive` action.
value_options:
- "yes"
- "no"
is_required: true
- xcodebuild_options:
opts:
category: xcodebuild configuration
title: Additional options for the xcodebuild command
summary: Additional options to be added to the executed xcodebuild command.
description: |-
Additional options to be added to the executed xcodebuild command.
Prefer using `Build settings (xcconfig)` input for specifying `-xcconfig` option. You can't use both.
`-destination` is set automatically, unless specified explicitely.
# xcodebuild log formatting
- log_formatter: xcpretty
opts:
category: xcodebuild log formatting
title: Log formatter
summary: Defines how `xcodebuild` command's log is formatted.
description: |-
Defines how `xcodebuild` command's log is formatted.
Available options:
- `xcpretty`: The xcodebuild command's output will be prettified by xcpretty.
- `xcodebuild`: Only the last 20 lines of raw xcodebuild output will be visible in the build log.
The raw xcodebuild log will be exported in both cases.
value_options:
- xcpretty
- xcodebuild
is_required: true
# Automatic code signing
- automatic_code_signing: "off"
opts:
category: Automatic code signing
title: Automatic code signing method
summary: This input determines which Bitrise Apple service connection should be used for automatic code signing.
description: |-
This input determines which Bitrise Apple service connection should be used for automatic code signing.
Available values:
- `off`: Do not do any auto code signing.
- `api-key`: [Bitrise Apple Service connection with API Key](https://devcenter.bitrise.io/getting-started/connecting-to-services/setting-up-connection-to-an-apple-service-with-api-key/).
- `apple-id`: [Bitrise Apple Service connection with Apple ID](https://devcenter.bitrise.io/getting-started/connecting-to-services/connecting-to-an-apple-service-with-apple-id/).
value_options:
- "off"
- api-key
- apple-id
is_required: true
- register_test_devices: "no"
opts:
category: Automatic code signing
title: Register test devices on the Apple Developer Portal
summary: If this input is set, the Step will register the known test devices on Bitrise from team members with the Apple Developer Portal.
description: |-
If this input is set, the Step will register the known test devices on Bitrise from team members with the Apple Developer Portal.
Note that setting this to yes may cause devices to be registered against your limited quantity of test devices in the Apple Developer Portal, which can only be removed once annually during your renewal window.
is_required: true
value_options:
- "yes"
- "no"
- test_device_list_path:
opts:
category: Automatic code signing
title: Path of file containing the devices to be registered
summary: If this input is set, the Step will register the listed devices from this file with the Apple Developer Portal.
description: |-
If this input is set, the Step will register the listed devices from this file with the Apple Developer Portal.
The format of the file is a comma separated list of the identifiers. For example:
`00000000–0000000000000001,00000000–0000000000000002,00000000–0000000000000003`
And in the above example the registered devices appear with the name of `Device 1`, `Device 2` and `Device 3` in the Apple Developer Portal.
Note that setting this will have a higher priority than the Bitrise provided devices list.
- min_profile_validity: "0"
opts:
category: Automatic code signing
title: The minimum days the Provisioning Profile should be valid
summary: If this input is set to >0, the managed Provisioning Profile will be renewed if it expires within the configured number of days.
description: |-
If this input is set to >0, the managed Provisioning Profile will be renewed if it expires within the configured number of days.
Otherwise the Step renews the managed Provisioning Profile if it is expired.
is_required: true
- certificate_url_list: $BITRISE_CERTIFICATE_URL
opts:
category: Automatic code signing
title: Code signing certificate URL
summary: URL of the code signing certificate to download.
description: |-
URL of the code signing certificate to download.
Multiple URLs can be specified, separated by a pipe (`|`) character.
Local file path can be specified, using the `file://` URL scheme.
is_required: true
is_sensitive: true
- passphrase_list: $BITRISE_CERTIFICATE_PASSPHRASE
opts:
category: Automatic code signing
title: Code signing certificate passphrase
summary: Passphrases for the provided code signing certificates.
description: |-
Passphrases for the provided code signing certificates.
Specify as many passphrases as many Code signing certificate URL provided, separated by a pipe (`|`) character.
Certificates without a passphrase: for using a single certificate, leave this step input empty. For multiple certificates, use the separator as if there was a passphrase (examples: `pass|`, `|pass|`, `|`)
is_required: false # A single cert with an empty passphrase is allowed too
is_sensitive: true
- keychain_path: $HOME/Library/Keychains/login.keychain
opts:
category: Automatic code signing
title: Keychain path
summary: Path to the Keychain where the code signing certificates will be installed.
is_required: true
is_dont_change_value: true
- keychain_password: $BITRISE_KEYCHAIN_PASSWORD
opts:
category: Automatic code signing
title: Keychain password
summary: Password for the provided Keychain.
is_required: true
is_sensitive: true
is_dont_change_value: true
- fallback_provisioning_profile_url_list:
opts:
category: Automatic code signing
title: Fallback provisioning profile URLs
description: |
If set, provided provisioning profiles will be used on Automatic code signing error.
URL of the provisioning profile to download. Multiple URLs can be specified, separated by a newline or pipe (`|`) character.
You can specify a local path as well, using the `file://` scheme.
For example: `file://./BuildAnything.mobileprovision`.
Can also provide a local directory that contains files with `.mobileprovision` extension.
For example: `./profilesDirectory/`
is_sensitive: true
# IPA export configuration
- export_development_team:
opts:
category: IPA export configuration
title: Developer Portal team
summary: The Developer Portal team to use for this export.
description: |-
The Developer Portal team to use for this export
Defaults to the team used to build the archive.
Defining this is also required when Automatic Code Signing is set to `apple-id` and the connected account belongs to multiple teams.
- compile_bitcode: "yes"
opts:
category: IPA export configuration
title: Rebuild from bitcode
summary: For __non-App Store__ exports, should Xcode re-compile the app from bitcode?
value_options:
- "yes"
- "no"
is_required: true
- upload_bitcode: "yes"
opts:
category: IPA export configuration
title: Include bitcode
summary: For __App Store__ exports, should the package include bitcode?
value_options:
- "yes"
- "no"
is_required: true
- icloud_container_environment:
opts:
category: IPA export configuration
title: iCloud container environment
summary: If the app is using CloudKit, this configures the `com.apple.developer.icloud-container-environment` entitlement.
description: |-
If the app is using CloudKit, this configures the `com.apple.developer.icloud-container-environment` entitlement.
Available options vary depending on the type of provisioning profile used, but may include: `Development` and `Production`.
- export_options_plist_content:
opts:
category: IPA export configuration
title: Export options plist content
summary: Specifies a plist file content that configures archive exporting.
description: |-
Specifies a plist file content that configures archive exporting.
If not specified, the Step will auto-generate it.
# Step Output Export configuration
- output_dir: $BITRISE_DEPLOY_DIR
opts:
category: Step Output Export configuration
title: Output directory path
summary: This directory will contain the generated artifacts.
is_required: true
- export_all_dsyms: "yes"
opts:
category: Step Output Export configuration
title: Export all dSYMs
summary: Export additional dSYM files besides the app dSYM file for Frameworks.
value_options:
- "yes"
- "no"
is_required: true
- artifact_name:
opts:
category: Step Output Export configuration
title: Override generated artifact names
summary: This name will be used as basename for the generated Xcode Archive, App, IPA and dSYM files.
description: |-
This name will be used as basename for the generated Xcode Archive, App, IPA and dSYM files.
If not specified, the Product Name (`PRODUCT_NAME`) Build settings value will be used.
If Product Name is not specified, the Scheme will be used.
# Caching
- cache_level: swift_packages
opts:
category: Caching
title: Enable collecting cache content
summary: Defines what cache content should be automatically collected.
description: |-
Defines what cache content should be automatically collected.
Available options:
- `none`: Disable collecting cache content
- `swift_packages`: Collect Swift PM packages added to the Xcode project
value_options:
- none
- swift_packages
is_required: true
# App Store Connect connection override
- api_key_path:
opts:
category: App Store Connect connection override
title: App Store Connect API private key
summary: Local path or remote URL to the private key (p8 file). This overrides the Bitrise-managed API connection.
description: |-
Local path or remote URL to the private key (p8 file) for App Store Connect API.
This overrides the Bitrise-managed API connection, only set this input if you want to control the API connection
on a step-level. Most of the time it's easier to set up the connection on the App Settings page on Bitrise.
The input value can be a file path (eg. `$TMPDIR/private_key.p8`) or an HTTPS URL.
This input only takes effect if the other two connection override inputs are set too (`api_key_id`, `api_key_issuer_id`).
- api_key_id:
opts:
category: App Store Connect connection override
title: App Store Connect API key ID
summary: Private key ID used for App Store Connect authentication. This overrides the Bitrise-managed API connection.
description: |-
Private key ID used for App Store Connect authentication.
This overrides the Bitrise-managed API connection, only set this input if you want to control the API connection
on a step-level. Most of the time it's easier to set up the connection on the App Settings page on Bitrise.
This input only takes effect if the other two connection override inputs are set too (`api_key_path`, `api_key_issuer_id`).
- api_key_issuer_id:
opts:
category: App Store Connect connection override
title: App Store Connect API issuer ID
summary: Private key issuer ID used for App Store Connect authentication. This overrides the Bitrise-managed API connection.
description: |-
Private key issuer ID used for App Store Connect authentication.
This overrides the Bitrise-managed API connection, only set this input if you want to control the API connection
on a step-level. Most of the time it's easier to set up the connection on the App Settings page on Bitrise.
This input only takes effect if the other two connection override inputs are set too (`api_key_path`, `api_key_id`).
- api_key_enterprise_account: "no"
opts:
category: App Store Connect connection override
title: App Store Connect API enterprise account
summary: Indicates if the account is an enterprise type. This overrides the Bitrise-managed API connection.
description: |-
Indicates if the account is an enterprise type.
This overrides the Bitrise-managed API connection, only set this input if you know you have an enterprise account.
value_options:
- "yes"
- "no"
is_required: true
# Debugging
- verbose_log: "no"
opts:
category: Debugging
title: Enable verbose logging
summary: If this input is set, the Step will print additional logs for debugging.
value_options:
- "yes"
- "no"
is_required: true
outputs:
- BITRISE_IPA_PATH:
opts:
title: .ipa file path
summary: Local path of the created .ipa file
- BITRISE_APP_DIR_PATH:
opts:
title: .app directory path
summary: Local path of the generated `.app` directory
- BITRISE_DSYM_DIR_PATH:
opts:
title: The created .dSYM dir's path
description: |-
This Environment Variable points to the path of the directory which contains the dSYMs files.
If `export_all_dsyms` is set to `yes`, the Step will collect every dSYM (app dSYMs and framwork dSYMs).
- BITRISE_DSYM_PATH:
opts:
title: The created .dSYM.zip file's path
description: |-
This Environment Variable points to the path of the zip file which contains the dSYM files.
If `export_all_dsyms` is set to `yes`, the Step will also collect framework dSYMs in addition to app dSYMs.
- BITRISE_XCARCHIVE_PATH:
opts:
title: .xcarchive file path
summary: The created .xcarchive file's path
- BITRISE_XCARCHIVE_ZIP_PATH:
opts:
title: .xcarchive.zip path
summary: The created .xcarchive.zip file's path.
- BITRISE_XCODEBUILD_ARCHIVE_LOG_PATH:
opts:
title: "`xcodebuild archive` command log file path"
description: |-
The file path of the raw `xcodebuild archive` command log. The log is placed into the `Output directory path`.
- BITRISE_XCODEBUILD_EXPORT_ARCHIVE_LOG_PATH:
opts:
title: "`xcodebuild -exportArchive` command log file path"
description: |-
The file path of the raw `xcodebuild -exportArchive` command log. The log is placed into the `Output directory path`.
- BITRISE_IDEDISTRIBUTION_LOGS_PATH:
opts:
title: Path to the xcdistributionlogs
description: |-
Exported when `xcodebuild -exportArchive` command fails.