Skip to content

Commit f7a6d87

Browse files
authored
[SWAT-784] Workaround for iTMSTransporter 3.0+fastlane (#126)
* Workaround for iTMSTransporter 3.0+fastlane * Check Xcode version, do not add Transporter params on Xcode 14
1 parent 2901f98 commit f7a6d87

File tree

5 files changed

+113
-5
lines changed

5 files changed

+113
-5
lines changed

main.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/bitrise-io/go-utils/retry"
1919
"github.com/bitrise-io/go-xcode/appleauth"
2020
"github.com/bitrise-io/go-xcode/devportalservice"
21+
"github.com/bitrise-io/go-xcode/utility"
2122
"github.com/kballard/go-shellquote"
2223
)
2324

@@ -385,15 +386,22 @@ alphanumeric characters.`)
385386
options = opts
386387
}
387388

388-
envs := []string{}
389-
if cfg.ITMSParameters != "" {
390-
envs = append(envs, "DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="+cfg.ITMSParameters)
389+
version, err := utility.GetXcodeVersion()
390+
if err != nil {
391+
fail("Failed to read Xcode version: %w", err)
391392
}
392393

393-
args := []string{
394-
"deliver",
394+
envs := []string{}
395+
// Xcode 14 and above fastlane uses altool to upload
396+
if version.MajorVersion < 14 {
397+
envs = append(envs, "ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true")
398+
if cfg.ITMSParameters != "" {
399+
envs = append(envs, "DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="+cfg.ITMSParameters)
400+
}
395401
}
396402

403+
args := []string{"deliver"}
404+
397405
authParams, err := FastlaneAuthParams(authConfig)
398406
if err != nil {
399407
fail("Failed to set up Fastlane authentication paramteres: %v", err)

vendor/github.com/bitrise-io/go-xcode/models/models.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/bitrise-io/go-xcode/utility/path.go

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/bitrise-io/go-xcode/utility/utility.go

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ github.com/bitrise-io/go-utils/retry
1919
## explicit
2020
github.com/bitrise-io/go-xcode/appleauth
2121
github.com/bitrise-io/go-xcode/devportalservice
22+
github.com/bitrise-io/go-xcode/models
23+
github.com/bitrise-io/go-xcode/utility
2224
# github.com/davecgh/go-spew v1.1.1
2325
github.com/davecgh/go-spew/spew
2426
# github.com/hashicorp/go-cleanhttp v0.5.2

0 commit comments

Comments
 (0)