fastlane 2.183.1 → 2.185.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +102 -95
  3. data/cert/lib/cert/runner.rb +3 -7
  4. data/deliver/lib/deliver/commands_generator.rb +1 -1
  5. data/deliver/lib/deliver/detect_values.rb +5 -3
  6. data/deliver/lib/deliver/download_screenshots.rb +1 -1
  7. data/deliver/lib/deliver/html_generator.rb +2 -2
  8. data/deliver/lib/deliver/module.rb +6 -0
  9. data/deliver/lib/deliver/options.rb +36 -51
  10. data/deliver/lib/deliver/runner.rb +8 -11
  11. data/deliver/lib/deliver/setup.rb +1 -1
  12. data/deliver/lib/deliver/submit_for_review.rb +1 -1
  13. data/deliver/lib/deliver/upload_metadata.rb +20 -6
  14. data/deliver/lib/deliver/upload_price_tier.rb +1 -1
  15. data/deliver/lib/deliver/upload_screenshots.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/adb.rb +1 -4
  17. data/fastlane/lib/fastlane/actions/adb_devices.rb +0 -1
  18. data/fastlane/lib/fastlane/actions/add_git_tag.rb +4 -4
  19. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +10 -15
  20. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +12 -2
  21. data/fastlane/lib/fastlane/actions/appetize.rb +0 -7
  22. data/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +0 -11
  23. data/fastlane/lib/fastlane/actions/appium.rb +40 -65
  24. data/fastlane/lib/fastlane/actions/apteligent.rb +3 -2
  25. data/fastlane/lib/fastlane/actions/artifactory.rb +5 -6
  26. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +6 -11
  27. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +2 -2
  28. data/fastlane/lib/fastlane/actions/badge.rb +9 -13
  29. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +1 -3
  30. data/fastlane/lib/fastlane/actions/bundle_install.rb +8 -10
  31. data/fastlane/lib/fastlane/actions/carthage.rb +2 -16
  32. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +8 -17
  33. data/fastlane/lib/fastlane/actions/chatwork.rb +3 -2
  34. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +5 -1
  35. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +0 -1
  36. data/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb +0 -1
  37. data/fastlane/lib/fastlane/actions/cloc.rb +9 -13
  38. data/fastlane/lib/fastlane/actions/cocoapods.rb +9 -15
  39. data/fastlane/lib/fastlane/actions/commit_github_file.rb +1 -3
  40. data/fastlane/lib/fastlane/actions/commit_version_bump.rb +6 -7
  41. data/fastlane/lib/fastlane/actions/copy_artifacts.rb +3 -4
  42. data/fastlane/lib/fastlane/actions/crashlytics.rb +7 -11
  43. data/fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb +70 -76
  44. data/fastlane/lib/fastlane/actions/create_keychain.rb +9 -10
  45. data/fastlane/lib/fastlane/actions/create_pull_request.rb +0 -9
  46. data/fastlane/lib/fastlane/actions/danger.rb +6 -11
  47. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +1 -1
  48. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +35 -16
  49. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +10 -4
  50. data/fastlane/lib/fastlane/actions/get_certificates.rb +5 -1
  51. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +5 -1
  52. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +5 -1
  53. data/fastlane/lib/fastlane/actions/register_device.rb +7 -10
  54. data/fastlane/lib/fastlane/actions/register_devices.rb +7 -10
  55. data/fastlane/lib/fastlane/actions/set_changelog.rb +7 -10
  56. data/fastlane/lib/fastlane/actions/swiftlint.rb +17 -15
  57. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +6 -1
  58. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +5 -1
  59. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +2 -1
  60. data/fastlane/lib/fastlane/environment_printer.rb +1 -0
  61. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +4 -4
  62. data/fastlane/lib/fastlane/helper/git_helper.rb +12 -7
  63. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -1
  64. data/fastlane/lib/fastlane/setup/setup_ios.rb +3 -3
  65. data/fastlane/lib/fastlane/swift_fastlane_function.rb +8 -5
  66. data/fastlane/lib/fastlane/version.rb +1 -1
  67. data/fastlane/swift/Deliverfile.swift +1 -1
  68. data/fastlane/swift/DeliverfileProtocol.swift +20 -20
  69. data/fastlane/swift/Fastlane.swift +4096 -3668
  70. data/fastlane/swift/Gymfile.swift +1 -1
  71. data/fastlane/swift/GymfileProtocol.swift +1 -1
  72. data/fastlane/swift/Matchfile.swift +1 -1
  73. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  74. data/fastlane/swift/OptionalConfigValue.swift +2 -32
  75. data/fastlane/swift/Precheckfile.swift +1 -1
  76. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  77. data/fastlane/swift/Scanfile.swift +1 -1
  78. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  79. data/fastlane/swift/Screengrabfile.swift +1 -1
  80. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  81. data/fastlane/swift/Snapshotfile.swift +1 -1
  82. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  83. data/fastlane/swift/formatting/Brewfile.lock.json +11 -11
  84. data/fastlane_core/lib/fastlane_core/build_watcher.rb +26 -3
  85. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +5 -0
  86. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +5 -3
  87. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +1 -1
  88. data/fastlane_core/lib/fastlane_core/helper.rb +12 -0
  89. data/fastlane_core/lib/fastlane_core/print_table.rb +5 -3
  90. data/fastlane_core/lib/fastlane_core/project.rb +7 -3
  91. data/match/lib/match/importer.rb +6 -10
  92. data/match/lib/match/migrate.rb +2 -3
  93. data/match/lib/match/nuke.rb +3 -7
  94. data/match/lib/match/options.rb +1 -0
  95. data/match/lib/match/runner.rb +2 -3
  96. data/match/lib/match/spaceship_ensure.rb +3 -0
  97. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  98. data/match/lib/match/storage/s3_storage.rb +2 -2
  99. data/pilot/lib/pilot/build_manager.rb +7 -1
  100. data/pilot/lib/pilot/manager.rb +3 -7
  101. data/pilot/lib/pilot/options.rb +10 -2
  102. data/precheck/lib/precheck/runner.rb +8 -7
  103. data/sigh/lib/assets/resign.sh +81 -61
  104. data/sigh/lib/sigh/download_all.rb +4 -8
  105. data/sigh/lib/sigh/runner.rb +4 -8
  106. data/snapshot/lib/snapshot/test_command_generator.rb +1 -1
  107. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +36 -4
  108. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +10 -0
  109. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +2 -3
  110. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +3 -1
  111. data/spaceship/lib/spaceship/connect_api/models/build.rb +2 -0
  112. data/spaceship/lib/spaceship/connect_api/token.rb +6 -0
  113. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +4 -2
  114. data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -6
  115. data/supply/lib/supply/client.rb +2 -2
  116. data/supply/lib/supply/uploader.rb +2 -2
  117. metadata +20 -22
  118. data/supply/lib/supply/.client.rb.swp +0 -0
  119. data/supply/lib/supply/.listing.rb.swp +0 -0
  120. data/supply/lib/supply/.uploader.rb.swp +0 -0
@@ -105,46 +105,45 @@ module Fastlane
105
105
  env_name: "KEYCHAIN_NAME",
106
106
  description: "Keychain name",
107
107
  conflicting_options: [:path],
108
- is_string: true,
109
108
  optional: true),
110
109
  FastlaneCore::ConfigItem.new(key: :path,
111
110
  env_name: "KEYCHAIN_PATH",
112
111
  description: "Path to keychain",
113
- is_string: true,
114
112
  conflicting_options: [:name],
115
113
  optional: true),
116
114
  FastlaneCore::ConfigItem.new(key: :password,
117
115
  env_name: "KEYCHAIN_PASSWORD",
118
116
  description: "Password for the keychain",
119
117
  sensitive: true,
118
+ code_gen_sensitive: true,
120
119
  optional: false),
121
120
  FastlaneCore::ConfigItem.new(key: :default_keychain,
122
121
  description: 'Should the newly created Keychain be the new system default keychain',
123
- is_string: false,
122
+ type: Boolean,
124
123
  default_value: false),
125
124
  FastlaneCore::ConfigItem.new(key: :unlock,
126
125
  description: 'Unlock keychain after create',
127
- is_string: false,
126
+ type: Boolean,
128
127
  default_value: false),
129
128
  FastlaneCore::ConfigItem.new(key: :timeout,
130
- description: 'timeout interval in seconds. Set `false` if you want to specify "no time-out"',
131
- is_string: false,
129
+ description: 'timeout interval in seconds',
130
+ type: Integer,
132
131
  default_value: 300),
133
132
  FastlaneCore::ConfigItem.new(key: :lock_when_sleeps,
134
133
  description: 'Lock keychain when the system sleeps',
135
- is_string: false,
134
+ type: Boolean,
136
135
  default_value: false),
137
136
  FastlaneCore::ConfigItem.new(key: :lock_after_timeout,
138
137
  description: 'Lock keychain after timeout interval',
139
- is_string: false,
138
+ type: Boolean,
140
139
  default_value: false),
141
140
  FastlaneCore::ConfigItem.new(key: :add_to_search_list,
142
141
  description: 'Add keychain to search list',
143
- is_string: false,
142
+ type: Boolean,
144
143
  default_value: true),
145
144
  FastlaneCore::ConfigItem.new(key: :require_create,
146
145
  description: 'Fail the action if the Keychain already exists',
147
- is_string: false,
146
+ type: Boolean,
148
147
  default_value: false)
149
148
  ]
150
149
  end
@@ -165,7 +165,6 @@ module Fastlane
165
165
  code_gen_sensitive: true,
166
166
  default_value: ENV["GITHUB_API_TOKEN"],
167
167
  default_value_dynamic: true,
168
- is_string: true,
169
168
  conflicting_options: [:api_bearer],
170
169
  optional: true),
171
170
  FastlaneCore::ConfigItem.new(key: :api_bearer,
@@ -173,24 +172,20 @@ module Fastlane
173
172
  description: "Use a Bearer authorization token. Usually generated by Github Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable",
174
173
  sensitive: true,
175
174
  code_gen_sensitive: true,
176
- is_string: true,
177
175
  conflicting_options: [:api_token],
178
176
  optional: true,
179
177
  default_value: nil),
180
178
  FastlaneCore::ConfigItem.new(key: :repo,
181
179
  env_name: "GITHUB_PULL_REQUEST_REPO",
182
180
  description: "The name of the repository you want to submit the pull request to",
183
- is_string: true,
184
181
  optional: false),
185
182
  FastlaneCore::ConfigItem.new(key: :title,
186
183
  env_name: "GITHUB_PULL_REQUEST_TITLE",
187
184
  description: "The title of the pull request",
188
- is_string: true,
189
185
  optional: false),
190
186
  FastlaneCore::ConfigItem.new(key: :body,
191
187
  env_name: "GITHUB_PULL_REQUEST_BODY",
192
188
  description: "The contents of the pull request",
193
- is_string: true,
194
189
  optional: true),
195
190
  FastlaneCore::ConfigItem.new(key: :draft,
196
191
  env_name: "GITHUB_PULL_REQUEST_DRAFT",
@@ -210,21 +205,17 @@ module Fastlane
210
205
  FastlaneCore::ConfigItem.new(key: :head,
211
206
  env_name: "GITHUB_PULL_REQUEST_HEAD",
212
207
  description: "The name of the branch where your changes are implemented (defaults to the current branch name)",
213
- is_string: true,
214
- code_gen_sensitive: true,
215
208
  default_value: Actions.git_branch,
216
209
  default_value_dynamic: true,
217
210
  optional: true),
218
211
  FastlaneCore::ConfigItem.new(key: :base,
219
212
  env_name: "GITHUB_PULL_REQUEST_BASE",
220
213
  description: "The name of the branch you want your changes pulled into (defaults to `master`)",
221
- is_string: true,
222
214
  default_value: 'master',
223
215
  optional: true),
224
216
  FastlaneCore::ConfigItem.new(key: :api_url,
225
217
  env_name: "GITHUB_PULL_REQUEST_API_URL",
226
218
  description: "The URL of GitHub API - used when the Enterprise (default to `https://api.github.com`)",
227
- is_string: true,
228
219
  code_gen_default_value: 'https://api.github.com',
229
220
  default_value: 'https://api.github.com',
230
221
  optional: true),
@@ -45,61 +45,56 @@ module Fastlane
45
45
  FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
46
46
  env_name: "FL_DANGER_USE_BUNDLE_EXEC",
47
47
  description: "Use bundle exec when there is a Gemfile presented",
48
- is_string: false,
48
+ type: Boolean,
49
49
  default_value: true),
50
50
  FastlaneCore::ConfigItem.new(key: :verbose,
51
51
  env_name: "FL_DANGER_VERBOSE",
52
52
  description: "Show more debugging information",
53
- is_string: false,
53
+ type: Boolean,
54
54
  default_value: false),
55
55
  FastlaneCore::ConfigItem.new(key: :danger_id,
56
56
  env_name: "FL_DANGER_ID",
57
57
  description: "The identifier of this Danger instance",
58
- is_string: true,
59
58
  optional: true),
60
59
  FastlaneCore::ConfigItem.new(key: :dangerfile,
61
60
  env_name: "FL_DANGER_DANGERFILE",
62
61
  description: "The location of your Dangerfile",
63
- is_string: true,
64
62
  optional: true),
65
63
  FastlaneCore::ConfigItem.new(key: :github_api_token,
66
64
  env_name: "FL_DANGER_GITHUB_API_TOKEN",
67
65
  description: "GitHub API token for danger",
68
66
  sensitive: true,
69
- is_string: true,
67
+ code_gen_sensitive: true,
70
68
  optional: true),
71
69
  FastlaneCore::ConfigItem.new(key: :fail_on_errors,
72
70
  env_name: "FL_DANGER_FAIL_ON_ERRORS",
73
71
  description: "Should always fail the build process, defaults to false",
74
- is_string: false,
72
+ type: Boolean,
75
73
  optional: true,
76
74
  default_value: false),
77
75
  FastlaneCore::ConfigItem.new(key: :new_comment,
78
76
  env_name: "FL_DANGER_NEW_COMMENT",
79
77
  description: "Makes Danger post a new comment instead of editing its previous one",
80
- is_string: false,
78
+ type: Boolean,
81
79
  optional: true,
82
80
  default_value: false),
83
81
  FastlaneCore::ConfigItem.new(key: :remove_previous_comments,
84
82
  env_name: "FL_DANGER_REMOVE_PREVIOUS_COMMENT",
85
83
  description: "Makes Danger remove all previous comment and create a new one in the end of the list",
86
- is_string: false,
84
+ type: Boolean,
87
85
  optional: true,
88
86
  default_value: false),
89
87
  FastlaneCore::ConfigItem.new(key: :base,
90
88
  env_name: "FL_DANGER_BASE",
91
89
  description: "A branch/tag/commit to use as the base of the diff. [master|dev|stable]",
92
- is_string: true,
93
90
  optional: true),
94
91
  FastlaneCore::ConfigItem.new(key: :head,
95
92
  env_name: "FL_DANGER_HEAD",
96
93
  description: "A branch/tag/commit to use as the head. [master|dev|stable]",
97
- is_string: true,
98
94
  optional: true),
99
95
  FastlaneCore::ConfigItem.new(key: :pr,
100
96
  env_name: "FL_DANGER_PR",
101
97
  description: "Run danger on a specific pull request. e.g. \"https://github.com/danger/danger/pull/518\"",
102
- is_string: true,
103
98
  optional: true),
104
99
  FastlaneCore::ConfigItem.new(key: :fail_if_no_pr,
105
100
  env_name: "FL_DANGER_FAIL_IF_NO_PR",
@@ -29,7 +29,7 @@ gem install fastlane
29
29
  androidTestImplementation 'tools.fastlane:screengrab:x.x.x'
30
30
  ```
31
31
 
32
- The latest version is [ ![Download](https://api.bintray.com/packages/fastlane/fastlane/screengrab/images/download.svg) ](https://bintray.com/fastlane/fastlane/screengrab/_latestVersion)
32
+ The latest version is [ ![Download](https://maven-badges.herokuapp.com/maven-central/tools.fastlane/screengrab/badge.svg)](https://search.maven.org/artifact/tools.fastlane/screengrab)
33
33
 
34
34
  As of Screengrab version 2.0.0, all Android test dependencies are AndroidX dependencies. This means a device with API 18+, Android 4.3 or greater is required. If you wish to capture screenshots with an older Android OS, then you must use a 1.x.x version.
35
35
 
@@ -288,7 +288,7 @@ reset_ratings(false)
288
288
  ##### app_rating_config_path
289
289
  You can set the app age ratings using _deliver_. You'll have to create and store a `JSON` configuration file. Copy the [template](https://github.com/fastlane/fastlane/blob/master/deliver/assets/example_rating_config.json) to your project folder and pass the path to the `JSON` file using the `app_rating_config_path` option.
290
290
 
291
- The keys/values on the top allow values from 0-2, and the items on the bottom allow only 0 or 1. More information in [#reference](#reference).
291
+ The keys/values on the top allow one of 3 strings: "NONE", "INFREQUENT_OR_MILD" or "FREQUENT_OR_INTENSE", and the items on the bottom allow false or true. More information in [#reference](#reference).
292
292
 
293
293
 
294
294
  ## Metadata
@@ -591,9 +591,9 @@ Key | Editable While Live | Directory | Filename | Deprecated Filename
591
591
 
592
592
  **Values**
593
593
 
594
- - 0: None
595
- - 1: Infrequent/Mild
596
- - 2: Frequent/Intense
594
+ - 0: None (Legacy value, use `NONE` instead)
595
+ - 1: Infrequent/Mild (Legacy value, use `INFREQUENT_OR_MILD` instead)
596
+ - 2: Frequent/Intense (Legacy value, use `FREQUENT_OR_INTENSE`instead)
597
597
 
598
598
  - `NONE`
599
599
  - `INFREQUENT_OR_MILD`
@@ -601,24 +601,43 @@ Key | Editable While Live | Directory | Filename | Deprecated Filename
601
601
 
602
602
  **Keys**
603
603
 
604
- - `violenceCartoonOrFantasy`
605
- - `violenceRealistic`
606
- - `violenceRealisticProlongedGraphicOrSadistic`
607
- - `profanityOrCrudeHumor`
608
- - `matureOrSuggestiveThemes`
609
- - `horrorOrFearThemes`
610
- - `medicalOrTreatmentInformation`
611
- - `alcoholTobaccoOrDrugUseOrReferences`
612
- - `gamblingSimulated`
613
- - `sexualContentOrNudity`
614
- - `sexualContentGraphicAndNudity`
604
+ - 'alcoholTobaccoOrDrugUseOrReferences'
605
+ - 'contests'
606
+ - 'gamblingSimulated'
607
+ - 'medicalOrTreatmentInformation'
608
+ - 'profanityOrCrudeHumor'
609
+
610
+ - 'sexualContentGraphicAndNudity'
611
+ - 'sexualContentOrNudity'
612
+ - 'horrorOrFearThemes'
613
+ - 'matureOrSuggestiveThemes'
614
+ - 'unrestrictedWebAccess'
615
+ - 'violenceCartoonOrFantasy'
616
+ - 'violenceRealisticProlongedGraphicOrSadistic'
617
+ - 'violenceRealistic'
618
+ - 'kidsAgeBand'
615
619
 
616
620
  #### Boolean
617
621
 
618
622
  **Keys**
619
623
 
624
+ - `gambling`
625
+ - 'seventeenPlus'
620
626
  - `unrestrictedWebAccess`
621
- - `gamblingAndContests`
627
+
628
+ #### Kids Age
629
+
630
+ **Values**
631
+
632
+ - `FIVE_AND_UNDER`
633
+ - `SIX_TO_EIGHT`
634
+ - `NINE_TO_ELEVEN`
635
+ - `null`
636
+
637
+ **Keys**
638
+
639
+ - `kidsAgeBand`
640
+
622
641
  </details>
623
642
 
624
643
  <br />
@@ -135,16 +135,16 @@ The output will look like this:
135
135
 
136
136
  ### Add a new tester
137
137
 
138
- To add a new tester to both your App Store Connect account and to your app (if given), use the `pilot add` command. This will create a new tester (if necessary) or add an existing tester to the app to test.
138
+ To add a new tester to your App Store Connect account and to associate it to at least one testing group of your app, use the `pilot add` command. This will create a new tester (if necessary) or add an existing tester to the app to test.
139
139
 
140
140
  ```no-highlight
141
- fastlane pilot add email@invite.com
141
+ fastlane pilot add email@invite.com -g group-1,group-2
142
142
  ```
143
143
 
144
144
  Additionally you can specify the app identifier (if necessary):
145
145
 
146
146
  ```no-highlight
147
- fastlane pilot add email@email.com -a com.krausefx.app
147
+ fastlane pilot add email@email.com -a com.krausefx.app -g group-1,group-2
148
148
  ```
149
149
 
150
150
  ### Find a tester
@@ -173,12 +173,18 @@ The resulting output will look like this:
173
173
 
174
174
  ### Remove a tester
175
175
 
176
- This command will only remove external beta testers.
176
+ This command will remove beta tester from app (from all internal and external groups)
177
177
 
178
178
  ```no-highlight
179
179
  fastlane pilot remove felix@krausefx.com
180
180
  ```
181
181
 
182
+ You can also use `groups` option to remove the tester from the groups specified:
183
+
184
+ ```no-highlight
185
+ fastlane pilot remove felix@krausefx.com -g group-1,group-2
186
+ ```
187
+
182
188
  ### Export testers
183
189
 
184
190
  To export all external testers to a CSV file. Useful if you need to import tester info to another system or a new account.
@@ -12,8 +12,12 @@ module Fastlane
12
12
  return if Helper.test?
13
13
 
14
14
  begin
15
+ # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
16
+ unless params[:api_key_path]
17
+ params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
18
+ end
19
+
15
20
  Cert.config = params # we alread have the finished config
16
- Cert.config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
17
21
 
18
22
  Cert::Runner.new.launch
19
23
  cert_file_path = ENV["CER_FILE_PATH"]
@@ -14,8 +14,12 @@ module Fastlane
14
14
  require 'sigh'
15
15
  require 'credentials_manager/appfile_config'
16
16
 
17
+ # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
18
+ unless values[:api_key_path]
19
+ values[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
20
+ end
21
+
17
22
  Sigh.config = values # we already have the finished config
18
- Sigh.config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
19
23
 
20
24
  path = Sigh::Manager.start
21
25
 
@@ -3,8 +3,12 @@ module Fastlane
3
3
  # Push local changes to the remote branch
4
4
  class PushToGitRemoteAction < Action
5
5
  def self.run(params)
6
+ # Find the local git branch using HEAD or fallback to CI's ENV git branch if you're in detached HEAD state
7
+ local_git_branch = Actions.git_branch_name_using_HEAD
8
+ local_git_branch = Actions.git_branch unless local_git_branch && local_git_branch != "HEAD"
9
+
6
10
  local_branch = params[:local_branch]
7
- local_branch ||= Actions.git_branch.gsub(%r{#{params[:remote]}\/}, '') if Actions.git_branch
11
+ local_branch ||= local_git_branch.gsub(%r{#{params[:remote]}\/}, '') if local_git_branch
8
12
  UI.user_error!('Failed to get the current branch.') unless local_branch
9
13
 
10
14
  remote_branch = params[:remote_branch] || local_branch
@@ -16,9 +16,11 @@ module Fastlane
16
16
 
17
17
  platform = Spaceship::ConnectAPI::BundleIdPlatform.map(platform)
18
18
 
19
- if (token = api_token(params))
20
- UI.message("Using App Store Connect API token...")
21
- Spaceship::ConnectAPI.token = token
19
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
20
+ UI.message("Creating authorization token for App Store Connect API")
21
+ Spaceship::ConnectAPI.token = api_token
22
+ elsif !Spaceship::ConnectAPI.token.nil?
23
+ UI.message("Using existing authorization token for App Store Connect API")
22
24
  else
23
25
  UI.message("Login to App Store Connect (#{params[:username]})")
24
26
  credentials = CredentialsManager::AccountManager.new(user: params[:username])
@@ -37,13 +39,6 @@ module Fastlane
37
39
  return udid
38
40
  end
39
41
 
40
- def self.api_token(params)
41
- params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
42
- api_token ||= Spaceship::ConnectAPI::Token.create(**params[:api_key]) if params[:api_key]
43
- api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path]
44
- return api_token
45
- end
46
-
47
42
  def self.description
48
43
  "Registers a new device to the Apple Dev Portal"
49
44
  end
@@ -80,6 +75,8 @@ module Fastlane
80
75
  env_names: ["FL_REGISTER_DEVICE_API_KEY", "APP_STORE_CONNECT_API_KEY"],
81
76
  description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
82
77
  type: Hash,
78
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
79
+ default_value_dynamic: true,
83
80
  optional: true,
84
81
  sensitive: true,
85
82
  conflicting_options: [:api_key_path]),
@@ -39,9 +39,11 @@ module Fastlane
39
39
  end
40
40
 
41
41
  require 'spaceship'
42
- if (token = api_token(params))
43
- UI.message("Using App Store Connect API token...")
44
- Spaceship::ConnectAPI.token = token
42
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
43
+ UI.message("Creating authorization token for App Store Connect API")
44
+ Spaceship::ConnectAPI.token = api_token
45
+ elsif !Spaceship::ConnectAPI.token.nil?
46
+ UI.message("Using existing authorization token for App Store Connect API")
45
47
  else
46
48
  UI.message("Login to App Store Connect (#{params[:username]})")
47
49
  credentials = CredentialsManager::AccountManager.new(user: params[:username])
@@ -83,13 +85,6 @@ module Fastlane
83
85
  UI.crash!("Failed to register new device (name: #{name}, UDID: #{udid})")
84
86
  end
85
87
 
86
- def self.api_token(params)
87
- params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
88
- api_token ||= Spaceship::ConnectAPI::Token.create(**params[:api_key]) if params[:api_key]
89
- api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path]
90
- return api_token
91
- end
92
-
93
88
  #####################################################
94
89
  # @!group Documentation
95
90
  #####################################################
@@ -129,6 +124,8 @@ module Fastlane
129
124
  env_names: ["FL_REGISTER_DEVICES_API_KEY", "APP_STORE_CONNECT_API_KEY"],
130
125
  description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
131
126
  type: Hash,
127
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
128
+ default_value_dynamic: true,
132
129
  optional: true,
133
130
  sensitive: true,
134
131
  conflicting_options: [:api_key_path]),
@@ -6,9 +6,11 @@ module Fastlane
6
6
 
7
7
  # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
8
8
  # Prompts select team if multiple teams and none specified
9
- if (token = self.api_token(params))
10
- UI.message("Using App Store Connect API token...")
11
- Spaceship::ConnectAPI.token = token
9
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
10
+ UI.message("Creating authorization token for App Store Connect API")
11
+ Spaceship::ConnectAPI.token = api_token
12
+ elsif !Spaceship::ConnectAPI.token.nil?
13
+ UI.message("Using existing authorization token for App Store Connect API")
12
14
  else
13
15
  UI.message("Login to App Store Connect (#{params[:username]})")
14
16
  Spaceship::ConnectAPI.login(params[:username], use_portal: false, use_tunes: true, tunes_team_id: params[:team_id], team_name: params[:team_name])
@@ -78,13 +80,6 @@ module Fastlane
78
80
  UI.success("👼 Successfully pushed the new changelog to for #{edit_version.version_string}")
79
81
  end
80
82
 
81
- def self.api_token(params)
82
- params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
83
- api_token ||= Spaceship::ConnectAPI::Token.create(**params[:api_key]) if params[:api_key]
84
- api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path]
85
- return api_token
86
- end
87
-
88
83
  def self.default_changelog_path
89
84
  File.join(FastlaneCore::FastlaneFolder.path.to_s, 'changelog.txt')
90
85
  end
@@ -122,6 +117,8 @@ module Fastlane
122
117
  env_names: ["FL_SET_CHANGELOG_API_KEY", "APP_STORE_CONNECT_API_KEY"],
123
118
  description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
124
119
  type: Hash,
120
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
121
+ default_value_dynamic: true,
125
122
  optional: true,
126
123
  sensitive: true,
127
124
  conflicting_options: [:api_key_path]),