Skip to content

Commit d6317e5

Browse files
Add testflight_internal_testing_only input (#368)
* added testflight-internal to distribution method * added testflight internal option * changed logic to add testFlightInternalOnly * updates * swapped order of value_options * added debug line * fixes for input value * changes * changed variable name testflight_internal_testing_only * added dependency of distribution_method = app-store * added dependency of distribution_method = app-store * changes * fixed typo * added warning if distribution method is not appstore and testflight internal testing only flag is set * updated mod and vendor to updated forks * update go.mod by running go mod tidy * updated README * Fix go-xcode imports * updated go-xcode dependencies * Moved testflight_internal_testing_only input to IPA export configuration category * PR cleanup * Update step.yml --------- Co-authored-by: Krisztián Gödrei <[email protected]>
1 parent 2ff5842 commit d6317e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1125
-393
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ _tmp
44
.idea/
55
.vscode
66
.DS_Store
7+
cli/
78
steps-xcode-archive

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Build a development IPA with custom xcconfig file path:
142142
| `compile_bitcode` | For __non-App Store__ exports, should Xcode re-compile the app from bitcode? | required | `yes` |
143143
| `upload_bitcode` | For __App Store__ exports, should the package include bitcode? | required | `yes` |
144144
| `icloud_container_environment` | 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`. | | |
145+
| `testflight_internal_testing_only` | Set this flag if the archive is for internal testflight distribution. Distribution method has to be set to app-store | required | `no` |
145146
| `export_options_plist_content` | Specifies a plist file content that configures archive exporting. If not specified, the Step will auto-generate it. | | |
146147
| `output_dir` | This directory will contain the generated artifacts. | required | `$BITRISE_DEPLOY_DIR` |
147148
| `export_all_dsyms` | Export additional dSYM files besides the app dSYM file for Frameworks. | required | `yes` |
@@ -150,6 +151,7 @@ Build a development IPA with custom xcconfig file path:
150151
| `api_key_path` | 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`). | | |
151152
| `api_key_id` | 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`). | | |
152153
| `api_key_issuer_id` | 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`). | | |
154+
| `api_key_enterprise_account` | 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. | required | `no` |
153155
| `verbose_log` | If this input is set, the Step will print additional logs for debugging. | required | `no` |
154156
</details>
155157

go.mod

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module github.com/bitrise-steplib/steps-xcode-archive
22

3-
go 1.21
3+
go 1.22
44

5-
toolchain go1.23.2
5+
toolchain go1.23.4
66

77
require (
88
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23
99
github.com/bitrise-io/go-utils v1.0.12
1010
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23
11-
github.com/bitrise-io/go-xcode v1.1.2-0.20241021091717-e6ebe7ad2c74
12-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.51
11+
github.com/bitrise-io/go-xcode v1.1.2
12+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.52
1313
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
14-
github.com/stretchr/testify v1.9.0
14+
github.com/stretchr/testify v1.10.0
1515
gopkg.in/yaml.v3 v3.0.1
1616
howett.net/plist v1.0.1
1717
)
@@ -23,16 +23,19 @@ require (
2323
github.com/davecgh/go-spew v1.1.1 // indirect
2424
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect
2525
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
26+
github.com/google/go-cmp v0.6.0 // indirect
2627
github.com/google/go-querystring v1.1.0 // indirect
2728
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
2829
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
2930
github.com/hashicorp/go-version v1.6.0 // indirect
31+
github.com/kr/pretty v0.3.1 // indirect
3032
github.com/pkg/errors v0.9.1 // indirect
3133
github.com/pmezard/go-difflib v1.0.0 // indirect
34+
github.com/rogpeppe/go-internal v1.10.0 // indirect
3235
github.com/ryanuber/go-glob v1.0.0 // indirect
3336
github.com/stretchr/objx v0.5.2 // indirect
34-
golang.org/x/crypto v0.29.0 // indirect
35-
golang.org/x/sys v0.27.0 // indirect
36-
golang.org/x/term v0.26.0 // indirect
37-
golang.org/x/text v0.20.0 // indirect
37+
golang.org/x/crypto v0.31.0 // indirect
38+
golang.org/x/sys v0.28.0 // indirect
39+
golang.org/x/term v0.27.0 // indirect
40+
golang.org/x/text v0.21.0 // indirect
3841
)

go.sum

+19-15
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ github.com/bitrise-io/go-utils v1.0.12 h1:iJV1ZpyvSA0NCte/N6x+aIQ9TrNr5sIBlcJBf0
1111
github.com/bitrise-io/go-utils v1.0.12/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
1212
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0=
1313
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68=
14-
github.com/bitrise-io/go-xcode v1.1.2-0.20241021091717-e6ebe7ad2c74 h1:gs74s+ljimZhALk+YwquKh6xLT+wHJ4NLK8nhukFaww=
15-
github.com/bitrise-io/go-xcode v1.1.2-0.20241021091717-e6ebe7ad2c74/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY=
16-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.51 h1:eSJpijzNbfcH4lFKxypjtGJSdJYDE7kM2oNpSPcE9C4=
17-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.51/go.mod h1:zGlkBf5p6YJ1cdVM9zSv+O7xa1r3B+dZFix4+9GxPgk=
14+
github.com/bitrise-io/go-xcode v1.1.2 h1:7tit56lNPPzH714pBt083z/iZh7P44vgVsNrEdvkYG4=
15+
github.com/bitrise-io/go-xcode v1.1.2/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY=
16+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.52 h1:j3PXdAdthp2ydlvoGbSUoAu+KIbrTQWHOynLr5WxCSk=
17+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.52/go.mod h1:T4rhWQljdgH5As4Dq/RQWuazdScY0YB7uZAMuBUnxeY=
18+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1819
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1920
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2021
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -47,16 +48,19 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn
4748
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
4849
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
4950
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
50-
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
5151
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
52+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
53+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
5254
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
5355
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
5456
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
5557
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
58+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
5659
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
5760
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
5861
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5962
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
63+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
6064
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
6165
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
6266
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
@@ -68,25 +72,25 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
6872
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
6973
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
7074
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
71-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
72-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
75+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
76+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7377
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
74-
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
75-
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
78+
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
79+
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
7680
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
7781
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7882
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7983
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8084
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
81-
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
82-
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
85+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
86+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
8387
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
8488
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
85-
golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
86-
golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
89+
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
90+
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
8791
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
88-
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
89-
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
92+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
93+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
9094
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
9195
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
9296
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

main.go

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func createRunOptions(config step.Config) step.RunOpts {
9292

9393
CustomExportOptionsPlistContent: config.ExportOptionsPlistContent,
9494
ExportMethod: config.ExportMethod,
95+
TestFlightInternalTestingOnly: config.TestFlightInternalTestingOnly,
9596
ICloudContainerEnvironment: config.ICloudContainerEnvironment,
9697
ExportDevelopmentTeam: config.ExportDevelopmentTeam,
9798
UploadBitcode: config.UploadBitcode,

step.yml

+10
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,16 @@ inputs:
350350
351351
Available options vary depending on the type of provisioning profile used, but may include: `Development` and `Production`.
352352
353+
- testflight_internal_testing_only: "no"
354+
opts:
355+
category: IPA export configuration
356+
title: Testflight Internal Testing Only
357+
summary: Set this flag if the archive is for internal testflight distribution. Distribution method has to be set to app-store
358+
value_options:
359+
- "yes"
360+
- "no"
361+
is_required: true
362+
353363
- export_options_plist_content:
354364
opts:
355365
category: IPA export configuration

step/step.go

+52-27
Original file line numberDiff line numberDiff line change
@@ -69,44 +69,58 @@ const (
6969

7070
// Inputs ...
7171
type Inputs struct {
72-
ExportMethod string `env:"distribution_method,opt[app-store,ad-hoc,enterprise,development]"`
73-
UploadBitcode bool `env:"upload_bitcode,opt[yes,no]"`
74-
CompileBitcode bool `env:"compile_bitcode,opt[yes,no]"`
75-
ICloudContainerEnvironment string `env:"icloud_container_environment"`
76-
ExportDevelopmentTeam string `env:"export_development_team"`
72+
ProjectPath string `env:"project_path,file"`
73+
Scheme string `env:"scheme,required"`
74+
ExportMethod string `env:"distribution_method,opt[app-store,ad-hoc,enterprise,development]"`
7775

78-
ExportOptionsPlistContent string `env:"export_options_plist_content"`
79-
80-
LogFormatter string `env:"log_formatter,opt[xcpretty,xcodebuild]"`
81-
ProjectPath string `env:"project_path,file"`
82-
Scheme string `env:"scheme,required"`
76+
// xcodebuild configuration
8377
Configuration string `env:"configuration"`
84-
OutputDir string `env:"output_dir,required"`
78+
XcconfigContent string `env:"xcconfig_content"`
8579
PerformCleanAction bool `env:"perform_clean_action,opt[yes,no]"`
8680
XcodebuildOptions string `env:"xcodebuild_options"`
87-
XcconfigContent string `env:"xcconfig_content"`
8881

89-
ExportAllDsyms bool `env:"export_all_dsyms,opt[yes,no]"`
90-
ArtifactName string `env:"artifact_name"`
91-
VerboseLog bool `env:"verbose_log,opt[yes,no]"`
92-
93-
CacheLevel string `env:"cache_level,opt[none,swift_packages]"`
82+
// xcodebuild log formatting
83+
LogFormatter string `env:"log_formatter,opt[xcpretty,xcodebuild]"`
9484

85+
// Automatic code signing
9586
CodeSigningAuthSource string `env:"automatic_code_signing,opt[off,api-key,apple-id]"`
87+
RegisterTestDevices bool `env:"register_test_devices,opt[yes,no]"`
88+
TestDeviceListPath string `env:"test_device_list_path"`
89+
MinDaysProfileValid int `env:"min_profile_validity,required"`
9690
CertificateURLList string `env:"certificate_url_list"`
9791
CertificatePassphraseList stepconf.Secret `env:"passphrase_list"`
9892
KeychainPath string `env:"keychain_path"`
9993
KeychainPassword stepconf.Secret `env:"keychain_password"`
100-
RegisterTestDevices bool `env:"register_test_devices,opt[yes,no]"`
101-
TestDeviceListPath string `env:"test_device_list_path"`
102-
MinDaysProfileValid int `env:"min_profile_validity,required"`
10394
FallbackProvisioningProfileURLs string `env:"fallback_provisioning_profile_url_list"`
104-
APIKeyPath stepconf.Secret `env:"api_key_path"`
105-
APIKeyID string `env:"api_key_id"`
106-
APIKeyIssuerID string `env:"api_key_issuer_id"`
107-
APIKeyEnterpriseAccount bool `env:"api_key_enterprise_account,opt[yes,no]"`
108-
BuildURL string `env:"BITRISE_BUILD_URL"`
109-
BuildAPIToken stepconf.Secret `env:"BITRISE_BUILD_API_TOKEN"`
95+
96+
// IPA export configuration
97+
ExportDevelopmentTeam string `env:"export_development_team"`
98+
CompileBitcode bool `env:"compile_bitcode,opt[yes,no]"`
99+
UploadBitcode bool `env:"upload_bitcode,opt[yes,no]"`
100+
ICloudContainerEnvironment string `env:"icloud_container_environment"`
101+
TestFlightInternalTestingOnly bool `env:"testflight_internal_testing_only,opt[yes,no]"`
102+
ExportOptionsPlistContent string `env:"export_options_plist_content"`
103+
104+
// Step Output Export configuration
105+
OutputDir string `env:"output_dir,required"`
106+
ExportAllDsyms bool `env:"export_all_dsyms,opt[yes,no]"`
107+
ArtifactName string `env:"artifact_name"`
108+
109+
// Caching
110+
CacheLevel string `env:"cache_level,opt[none,swift_packages]"`
111+
112+
// App Store Connect connection override
113+
APIKeyPath stepconf.Secret `env:"api_key_path"`
114+
APIKeyID string `env:"api_key_id"`
115+
APIKeyIssuerID string `env:"api_key_issuer_id"`
116+
APIKeyEnterpriseAccount bool `env:"api_key_enterprise_account,opt[yes,no]"`
117+
118+
// Debugging
119+
VerboseLog bool `env:"verbose_log,opt[yes,no]"`
120+
121+
// Hidden inputs
122+
BuildURL string `env:"BITRISE_BUILD_URL"`
123+
BuildAPIToken stepconf.Secret `env:"BITRISE_BUILD_API_TOKEN"`
110124
}
111125

112126
// Config ...
@@ -154,6 +168,7 @@ func (s XcodebuildArchiver) ProcessInputs() (Config, error) {
154168
s.logger.Println()
155169

156170
config := Config{Inputs: inputs}
171+
157172
s.logger.EnableDebugLog(config.VerboseLog)
158173
if config.VerboseLog {
159174
logv1.SetEnableDebugLog(true)
@@ -219,6 +234,12 @@ func (s XcodebuildArchiver) ProcessInputs() (Config, error) {
219234
}
220235
config.ExportOptionsPlistContent = exportOptionsPlistContent
221236

237+
if config.ExportMethod != "app-store" && config.TestFlightInternalTestingOnly {
238+
s.logger.Println()
239+
s.logger.Warnf("TestFlightInternalTestingOnly is valid only for Distribution Method app-store.")
240+
s.logger.Println()
241+
}
242+
222243
absProjectPath, err := filepath.Abs(config.ProjectPath)
223244
if err != nil {
224245
return Config{}, fmt.Errorf("failed to get absolute project path, error: %s", err)
@@ -323,6 +344,7 @@ type RunOpts struct {
323344
// IPA Export
324345
CustomExportOptionsPlistContent string
325346
ExportMethod string
347+
TestFlightInternalTestingOnly bool
326348
ICloudContainerEnvironment string
327349
ExportDevelopmentTeam string
328350
UploadBitcode bool
@@ -350,6 +372,7 @@ func (s XcodebuildArchiver) Run(opts RunOpts) (RunResult, error) {
350372
)
351373

352374
s.logger.Println()
375+
353376
if opts.XcodeMajorVersion >= 11 {
354377
s.logger.Infof("Running resolve Swift package dependencies")
355378
// Resolve Swift package dependencies, so running -showBuildSettings later is faster later
@@ -445,6 +468,7 @@ func (s XcodebuildArchiver) Run(opts RunOpts) (RunResult, error) {
445468
Archive: *archiveOut.Archive,
446469
CustomExportOptionsPlistContent: opts.CustomExportOptionsPlistContent,
447470
ExportMethod: opts.ExportMethod,
471+
TestFlightInternalTestingOnly: opts.TestFlightInternalTestingOnly,
448472
ICloudContainerEnvironment: opts.ICloudContainerEnvironment,
449473
ExportDevelopmentTeam: opts.ExportDevelopmentTeam,
450474
UploadBitcode: opts.UploadBitcode,
@@ -935,6 +959,7 @@ type xcodeIPAExportOpts struct {
935959
Archive xcarchive.IosArchive
936960
CustomExportOptionsPlistContent string
937961
ExportMethod string
962+
TestFlightInternalTestingOnly bool
938963
ICloudContainerEnvironment string
939964
ExportDevelopmentTeam string
940965
UploadBitcode bool
@@ -1011,7 +1036,7 @@ func (s XcodebuildArchiver) xcodeIPAExport(opts xcodeIPAExportOpts) (xcodeIPAExp
10111036

10121037
generator := exportoptionsgenerator.New(xcodeProj, scheme, configuration, s.logger)
10131038
exportOptions, err := generator.GenerateApplicationExportOptions(exportMethod, opts.ICloudContainerEnvironment, opts.ExportDevelopmentTeam,
1014-
opts.UploadBitcode, opts.CompileBitcode, archiveCodeSignIsXcodeManaged, signingStyle, int64(opts.XcodeMajorVersion))
1039+
opts.UploadBitcode, opts.CompileBitcode, archiveCodeSignIsXcodeManaged, signingStyle, int64(opts.XcodeMajorVersion), opts.TestFlightInternalTestingOnly)
10151040
if err != nil {
10161041
return out, err
10171042
}

0 commit comments

Comments
 (0)