fastlane 2.178.0 → 2.182.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +97 -84
- data/cert/lib/cert/commands_generator.rb +2 -1
- data/cert/lib/cert/options.rb +1 -0
- data/cert/lib/cert/runner.rb +4 -0
- data/deliver/lib/deliver/commands_generator.rb +2 -1
- data/deliver/lib/deliver/download_screenshots.rb +1 -2
- data/deliver/lib/deliver/languages.rb +1 -1
- data/deliver/lib/deliver/options.rb +3 -2
- data/deliver/lib/deliver/runner.rb +4 -0
- data/deliver/lib/deliver/setup.rb +0 -1
- data/deliver/lib/deliver/upload_metadata.rb +2 -1
- data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +5 -0
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +3 -3
- data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +1 -1
- data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
- data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +4 -0
- data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
- data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
- data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +18 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
- data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
- data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
- data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
- data/fastlane/lib/fastlane/actions/git_commit.rb +3 -1
- data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
- data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
- data/fastlane/lib/fastlane/actions/import_from_git.rb +5 -5
- data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/jira.rb +61 -14
- data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +1 -0
- data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
- data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
- data/fastlane/lib/fastlane/actions/slack.rb +155 -133
- data/fastlane/lib/fastlane/actions/sourcedocs.rb +164 -0
- data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
- data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -2
- data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +4 -2
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
- data/fastlane/lib/fastlane/commands_generator.rb +2 -1
- data/fastlane/lib/fastlane/fast_file.rb +10 -2
- data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
- data/fastlane/lib/fastlane/helper/git_helper.rb +19 -7
- data/fastlane/lib/fastlane/lane_manager.rb +3 -2
- data/fastlane/lib/fastlane/notification/slack.rb +56 -0
- data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
- data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -2
- data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +30 -35
- data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
- data/fastlane/lib/fastlane/setup/setup.rb +23 -10
- data/fastlane/lib/fastlane/swift_fastlane_function.rb +39 -14
- data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
- data/fastlane/lib/fastlane/version.rb +2 -2
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +3 -3
- data/fastlane/swift/Fastlane.swift +6852 -3824
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/LaneFileProtocol.swift +9 -3
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +1 -1
- data/fastlane/swift/OptionalConfigValue.swift +131 -0
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
- data/fastlane/swift/RubyCommand.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +5 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
- data/fastlane/swift/SocketClient.swift +2 -1
- data/fastlane/swift/SocketResponse.swift +4 -2
- data/fastlane/swift/formatting/Brewfile.lock.json +18 -16
- data/fastlane/swift/upgrade_manifest.json +1 -1
- data/fastlane_core/lib/fastlane_core.rb +22 -21
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +50 -9
- data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
- data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +5 -3
- data/fastlane_core/lib/fastlane_core/helper.rb +28 -5
- data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
- data/fastlane_core/lib/fastlane_core/queue_worker.rb +2 -2
- data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
- data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
- data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
- data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +12 -1
- data/frameit/lib/frameit/commands_generator.rb +2 -1
- data/gym/lib/gym/commands_generator.rb +2 -1
- data/gym/lib/gym/generators/package_command_generator.rb +4 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +13 -8
- data/gym/lib/gym/runner.rb +15 -4
- data/match/lib/match/change_password.rb +3 -3
- data/match/lib/match/commands_generator.rb +2 -1
- data/match/lib/match/encryption/interface.rb +1 -1
- data/match/lib/match/encryption/openssl.rb +2 -2
- data/match/lib/match/module.rb +1 -0
- data/pem/lib/pem/commands_generator.rb +2 -1
- data/pilot/lib/pilot/commands_generator.rb +2 -1
- data/pilot/lib/pilot/manager.rb +4 -0
- data/pilot/lib/pilot/options.rb +3 -2
- data/pilot/lib/pilot/tester_exporter.rb +0 -1
- data/pilot/lib/pilot/tester_manager.rb +0 -1
- data/precheck/lib/precheck/commands_generator.rb +2 -1
- data/precheck/lib/precheck/options.rb +1 -0
- data/precheck/lib/precheck/runner.rb +4 -0
- data/produce/lib/produce/commands_generator.rb +2 -1
- data/scan/lib/scan/commands_generator.rb +2 -1
- data/scan/lib/scan/options.rb +10 -5
- data/scan/lib/scan/runner.rb +54 -1
- data/scan/lib/scan/test_command_generator.rb +10 -8
- data/screengrab/lib/screengrab/android_environment.rb +6 -4
- data/screengrab/lib/screengrab/commands_generator.rb +2 -1
- data/screengrab/lib/screengrab/runner.rb +1 -1
- data/sigh/lib/sigh/commands_generator.rb +2 -1
- data/sigh/lib/sigh/options.rb +1 -0
- data/sigh/lib/sigh/runner.rb +4 -0
- data/snapshot/lib/assets/SnapfileTemplate +1 -1
- data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
- data/snapshot/lib/snapshot/commands_generator.rb +3 -1
- data/snapshot/lib/snapshot/options.rb +5 -0
- data/snapshot/lib/snapshot/reports_generator.rb +4 -0
- data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +8 -4
- data/spaceship/README.md +2 -12
- data/spaceship/lib/spaceship/base.rb +2 -2
- data/spaceship/lib/spaceship/commands_generator.rb +4 -2
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +6 -2
- data/spaceship/lib/spaceship/connect_api/token.rb +7 -1
- data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -9
- data/spaceship/lib/spaceship/tunes/members.rb +1 -1
- data/spaceship/lib/spaceship/ui.rb +2 -2
- data/supply/lib/supply/client.rb +3 -1
- data/supply/lib/supply/commands_generator.rb +2 -1
- data/supply/lib/supply/options.rb +2 -2
- data/supply/lib/supply/uploader.rb +1 -0
- metadata +53 -64
- data/gym/lib/gym/.runner.rb.swp +0 -0
- data/pilot/lib/pilot/tester_util.rb +0 -0
@@ -308,7 +308,7 @@ module Screengrab
|
|
308
308
|
if out =~ /Permission denied/
|
309
309
|
dir = File.dirname(path)
|
310
310
|
base = File.basename(path)
|
311
|
-
run_adb_command("-s #{device_serial} shell run-as #{@config[:app_package_name]}
|
311
|
+
run_adb_command("-s #{device_serial} shell run-as #{@config[:app_package_name]} \"tar -cC #{dir} #{base}\" | tar -xv -f- -C #{tempdir}",
|
312
312
|
print_all: false,
|
313
313
|
print_command: true)
|
314
314
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'commander'
|
2
2
|
require 'fastlane/version'
|
3
|
+
require 'fastlane_core/ui/help_formatter'
|
3
4
|
|
4
5
|
require_relative 'options'
|
5
6
|
require_relative 'resign'
|
@@ -23,7 +24,7 @@ module Sigh
|
|
23
24
|
program :help, 'Author', 'Felix Krause <sigh@krausefx.com>'
|
24
25
|
program :help, 'Website', 'https://fastlane.tools'
|
25
26
|
program :help, 'Documentation', 'https://docs.fastlane.tools/actions/sigh/'
|
26
|
-
program :help_formatter,
|
27
|
+
program :help_formatter, FastlaneCore::HelpFormatter
|
27
28
|
|
28
29
|
global_option('--verbose') { FastlaneCore::Globals.verbose = true }
|
29
30
|
global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
|
data/sigh/lib/sigh/options.rb
CHANGED
data/sigh/lib/sigh/runner.rb
CHANGED
@@ -21,6 +21,10 @@ module Sigh
|
|
21
21
|
UI.message("Creating authorization token for App Store Connect API")
|
22
22
|
Spaceship::ConnectAPI.token = api_token
|
23
23
|
else
|
24
|
+
# Username is now optional since addition of App Store Connect API Key
|
25
|
+
# Force asking for username to prompt user if not already set
|
26
|
+
Sigh.config.fetch(:username, force_ask: true)
|
27
|
+
|
24
28
|
# Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
|
25
29
|
# Prompts select team if multiple teams and none specified
|
26
30
|
UI.message("Starting login with user '#{Sigh.config[:username]}'")
|
@@ -27,7 +27,7 @@
|
|
27
27
|
# remove the '#' to clear all previously generated screenshots before creating new ones
|
28
28
|
# clear_previous_screenshots(true)
|
29
29
|
|
30
|
-
# Remove the '#' to set the status bar to 9:41 AM, and show full battery and reception.
|
30
|
+
# Remove the '#' to set the status bar to 9:41 AM, and show full battery and reception. See also override_status_bar_arguments for custom options.
|
31
31
|
# override_status_bar(true)
|
32
32
|
|
33
33
|
# Arguments to pass to the app on launch. See https://docs.fastlane.tools/actions/snapshot/#launch-arguments
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'commander'
|
2
2
|
|
3
|
+
require 'fastlane_core/ui/help_formatter'
|
4
|
+
|
3
5
|
require_relative 'module'
|
4
6
|
require_relative 'runner'
|
5
7
|
require_relative 'options'
|
@@ -21,7 +23,7 @@ module Snapshot
|
|
21
23
|
program :help, 'Author', 'Felix Krause <snapshot@krausefx.com>'
|
22
24
|
program :help, 'Website', 'https://fastlane.tools'
|
23
25
|
program :help, 'Documentation', 'https://docs.fastlane.tools/actions/snapshot/'
|
24
|
-
program :help_formatter,
|
26
|
+
program :help_formatter, FastlaneCore::HelpFormatter
|
25
27
|
|
26
28
|
global_option('--verbose', 'Shows a more verbose output') { FastlaneCore::Globals.verbose = true }
|
27
29
|
|
@@ -126,6 +126,11 @@ module Snapshot
|
|
126
126
|
description: "Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception",
|
127
127
|
default_value: false,
|
128
128
|
is_string: false),
|
129
|
+
FastlaneCore::ConfigItem.new(key: :override_status_bar_arguments,
|
130
|
+
env_name: 'SNAPSHOT_OVERRIDE_STATUS_BAR_ARGUMENTS',
|
131
|
+
description: "Fully customize the status bar by setting each option here. See `xcrun simctl status_bar --help`",
|
132
|
+
optional: true,
|
133
|
+
type: String),
|
129
134
|
FastlaneCore::ConfigItem.new(key: :localize_simulator,
|
130
135
|
env_name: 'SNAPSHOT_LOCALIZE_SIMULATOR',
|
131
136
|
description: "Enabling this option will configure the Simulator's system language",
|
@@ -84,6 +84,10 @@ module Snapshot
|
|
84
84
|
{
|
85
85
|
# snapshot in Xcode 9 saves screenshots with the SIMULATOR_DEVICE_NAME
|
86
86
|
# which includes spaces
|
87
|
+
'iPhone 12 Pro Max' => "iPhone 12 Pro Max",
|
88
|
+
'iPhone 12 Pro' => "iPhone 12 Pro",
|
89
|
+
'iPhone 12 mini' => "iPhone 12 mini",
|
90
|
+
'iPhone 12' => "iPhone 12",
|
87
91
|
'iPhone 11 Pro Max' => "iPhone 11 Pro Max",
|
88
92
|
'iPhone 11 Pro' => "iPhone 11 Pro",
|
89
93
|
'iPhone 11' => "iPhone 11",
|
@@ -14,6 +14,7 @@ module Snapshot
|
|
14
14
|
attr_accessor :app_identifier
|
15
15
|
attr_accessor :disable_slide_to_type
|
16
16
|
attr_accessor :override_status_bar
|
17
|
+
attr_accessor :override_status_bar_arguments
|
17
18
|
|
18
19
|
# xcode 8
|
19
20
|
attr_accessor :number_of_retries
|
@@ -47,6 +48,7 @@ module Snapshot
|
|
47
48
|
@concurrent_simulators = snapshot_config[:concurrent_simulators]
|
48
49
|
@disable_slide_to_type = snapshot_config[:disable_slide_to_type]
|
49
50
|
@override_status_bar = snapshot_config[:override_status_bar]
|
51
|
+
@override_status_bar_arguments = snapshot_config[:override_status_bar_arguments]
|
50
52
|
|
51
53
|
launch_arguments = Array(snapshot_config[:launch_arguments])
|
52
54
|
# if more than 1 set of arguments, use a tuple with an index
|
@@ -89,7 +89,7 @@ module Snapshot
|
|
89
89
|
log_path: xcodebuild_log_path(language: language, locale: locale)
|
90
90
|
)
|
91
91
|
|
92
|
-
devices.each { |device_type| override_status_bar(device_type) } if launcher_config.override_status_bar
|
92
|
+
devices.each { |device_type| override_status_bar(device_type, launcher_config.override_status_bar_arguments) } if launcher_config.override_status_bar
|
93
93
|
|
94
94
|
UI.important("Running snapshot on: #{devices.join(', ')}")
|
95
95
|
|
@@ -112,7 +112,7 @@ module Snapshot
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
def override_status_bar(device_type)
|
115
|
+
def override_status_bar(device_type, arguments = nil)
|
116
116
|
device_udid = TestCommandGenerator.device_udid(device_type)
|
117
117
|
|
118
118
|
UI.message("Launch Simulator #{device_type}")
|
@@ -120,9 +120,13 @@ module Snapshot
|
|
120
120
|
|
121
121
|
UI.message("Overriding Status Bar")
|
122
122
|
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
if arguments.nil? || arguments.empty?
|
124
|
+
# The time needs to be passed as ISO8601 so the simulator formats it correctly
|
125
|
+
time = Time.new(2007, 1, 9, 9, 41, 0)
|
126
|
+
arguments = "--time #{time.iso8601} --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100"
|
127
|
+
end
|
128
|
+
|
129
|
+
Helper.backticks("xcrun simctl status_bar #{device_udid} override #{arguments} &> /dev/null")
|
126
130
|
end
|
127
131
|
|
128
132
|
def clear_status_bar(device_type)
|
data/spaceship/README.md
CHANGED
@@ -111,21 +111,11 @@ When your Apple account has 2 factor verification enabled, you'll automatically
|
|
111
111
|
|
112
112
|
#### Web sessions
|
113
113
|
|
114
|
-
|
115
|
-
|
116
|
-
```sh
|
117
|
-
fastlane spaceauth -u user@example.org
|
118
|
-
```
|
119
|
-
|
120
|
-
This will authenticate you and provide a string that can be transferred to your CI system. Copy everything from `---\n` to your CI server and provide it as environment variable named `FASTLANE_SESSION`. For example:
|
121
|
-
|
122
|
-
```
|
123
|
-
export FASTLANE_SESSION='---\n- !ruby/object:HTTP::Cookie\n name: DES5c148586dfd451e55afbaaa5f62418f91\n value: HSARMTKNSRVTWFla1+yO4gVPowH17VaaaxPFnUdMUegQZxqy1Ie1c2v6bM1vSOzIbuOmrl/FNenlScsd/NbF7/Lw4cpnL15jsyg0TOJwP32tC/NguPiyOaaaU+jrj4tf4uKdIywVaaaFSRVT\n domain: idmsa.apple.com\n for_domain: true\n path: "/"\n secure: true\n httponly: true\n expires: 2016-04-27 23:55:56.000000000 Z\n max_age: \n created_at: 2016-03-28 16:55:57.032086000 -07:00\n accessed_at: 2016-03-28 19:11:17.828141000 -07:00\n'
|
124
|
-
```
|
114
|
+
See [Continuous Integration > Authenticating with Apple services > Method 2: Two-step or two-factor authentication > Storing a manually verified session using spaceauth](https://docs.fastlane.tools/best-practices/continuous-integration/#storing-a-manually-verified-session-using-spaceauth)
|
125
115
|
|
126
116
|
#### Transporter
|
127
117
|
|
128
|
-
See [
|
118
|
+
See [Getting Started > iOS > Authentication > Method 3: Application-specific passwords](https://docs.fastlane.tools/getting-started/ios/authentication/#method-3-application-specific-passwords)
|
129
119
|
|
130
120
|
## _spaceship_ in use
|
131
121
|
|
@@ -89,12 +89,12 @@ module Spaceship
|
|
89
89
|
##
|
90
90
|
# Sets client and returns self for chaining.
|
91
91
|
# @return (Spaceship::Base)
|
92
|
-
# rubocop:disable
|
92
|
+
# rubocop:disable Naming/AccessorMethodName
|
93
93
|
def set_client(client)
|
94
94
|
self.client = client
|
95
95
|
self
|
96
96
|
end
|
97
|
-
# rubocop:enable
|
97
|
+
# rubocop:enable Naming/AccessorMethodName
|
98
98
|
|
99
99
|
##
|
100
100
|
# Binds attributes getters and setters to underlying data returned from the API.
|
@@ -3,6 +3,7 @@ require 'highline'
|
|
3
3
|
HighLine.track_eof = false
|
4
4
|
|
5
5
|
require 'fastlane/version'
|
6
|
+
require 'fastlane_core/ui/help_formatter'
|
6
7
|
require_relative 'playground'
|
7
8
|
require_relative 'spaceauth_runner'
|
8
9
|
|
@@ -21,7 +22,7 @@ module Spaceship
|
|
21
22
|
program :help, 'Author', 'Felix Krause <spaceship@krausefx.com>'
|
22
23
|
program :help, 'Website', 'https://fastlane.tools'
|
23
24
|
program :help, 'GitHub', 'https://github.com/fastlane/fastlane/tree/master/spaceship'
|
24
|
-
program :help_formatter,
|
25
|
+
program :help_formatter, FastlaneCore::HelpFormatter
|
25
26
|
|
26
27
|
global_option('-u', '--user USERNAME', 'Specify the Apple ID you want to log in with')
|
27
28
|
global_option('--verbose') { FastlaneCore::Globals.verbose = true }
|
@@ -39,9 +40,10 @@ module Spaceship
|
|
39
40
|
command :spaceauth do |c|
|
40
41
|
c.syntax = 'fastlane spaceship spaceauth'
|
41
42
|
c.description = 'Authentication helper for spaceship/fastlane to work with Apple 2-Step/2FA'
|
43
|
+
c.option('--copy_to_clipboard', 'Whether the session string should be copied to clipboard. For more info see https://docs.fastlane.tools/best-practices/continuous-integration/#storing-a-manually-verified-session-using-spaceauth`')
|
42
44
|
|
43
45
|
c.action do |args, options|
|
44
|
-
Spaceship::SpaceauthRunner.new(username: options.user).run
|
46
|
+
Spaceship::SpaceauthRunner.new(username: options.user, copy_to_clipboard: options.copy_to_clipboard).run
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
@@ -112,7 +112,7 @@ module Spaceship
|
|
112
112
|
timeout_minutes = (ENV["SPACESHIP_SCREENSHOT_UPLOAD_TIMEOUT"] || 20).to_i
|
113
113
|
|
114
114
|
loop do
|
115
|
-
# This error handling needs to be revised since any error
|
115
|
+
# This error handling needs to be revised since any error occurred can reach here.
|
116
116
|
# It should handle errors based on what status code is.
|
117
117
|
puts("Waiting for screenshots to appear before uploading. This is unlikely to be recovered unless it's 503 error. error=\"#{error}\"")
|
118
118
|
sleep(30)
|
@@ -92,6 +92,12 @@ module Spaceship
|
|
92
92
|
return resps.flat_map(&:to_models)
|
93
93
|
end
|
94
94
|
|
95
|
+
def fetch_all_certificates(client: nil, filter: {}, includes: nil, sort: nil)
|
96
|
+
client ||= Spaceship::ConnectAPI
|
97
|
+
resps = client.get_certificates(profile_id: id, filter: filter, includes: includes).all_pages
|
98
|
+
return resps.flat_map(&:to_models)
|
99
|
+
end
|
100
|
+
|
95
101
|
def delete!(client: nil)
|
96
102
|
client ||= Spaceship::ConnectAPI
|
97
103
|
return client.delete_profile(profile_id: id)
|
@@ -84,9 +84,13 @@ module Spaceship
|
|
84
84
|
# certificates
|
85
85
|
#
|
86
86
|
|
87
|
-
def get_certificates(filter: {}, includes: nil, limit: nil, sort: nil)
|
87
|
+
def get_certificates(profile_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
88
88
|
params = provisioning_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
89
|
-
|
89
|
+
if profile_id.nil?
|
90
|
+
provisioning_request_client.get("certificates", params)
|
91
|
+
else
|
92
|
+
provisioning_request_client.get("profiles/#{profile_id}/certificates", params)
|
93
|
+
end
|
90
94
|
end
|
91
95
|
|
92
96
|
def get_certificate(certificate_id: nil, includes: nil)
|
@@ -60,14 +60,16 @@ module Spaceship
|
|
60
60
|
key_id: key_id,
|
61
61
|
issuer_id: issuer_id,
|
62
62
|
key: OpenSSL::PKey::EC.new(key),
|
63
|
+
key_raw: key,
|
63
64
|
duration: duration,
|
64
65
|
in_house: in_house
|
65
66
|
)
|
66
67
|
end
|
67
68
|
|
68
|
-
def initialize(key_id: nil, issuer_id: nil, key: nil, duration: nil, in_house: nil)
|
69
|
+
def initialize(key_id: nil, issuer_id: nil, key: nil, key_raw: nil, duration: nil, in_house: nil)
|
69
70
|
@key_id = key_id
|
70
71
|
@key = key
|
72
|
+
@key_raw = key_raw
|
71
73
|
@issuer_id = issuer_id
|
72
74
|
@duration = duration
|
73
75
|
@in_house = in_house
|
@@ -97,6 +99,10 @@ module Spaceship
|
|
97
99
|
def expired?
|
98
100
|
@expiration < Time.now
|
99
101
|
end
|
102
|
+
|
103
|
+
def write_key_to_file(path)
|
104
|
+
File.open(path, 'w') { |f| f.write(@key_raw) }
|
105
|
+
end
|
100
106
|
end
|
101
107
|
end
|
102
108
|
end
|
@@ -1,15 +1,17 @@
|
|
1
1
|
require 'colored'
|
2
2
|
require 'credentials_manager/appfile_config'
|
3
3
|
require 'yaml'
|
4
|
+
require 'fastlane_core'
|
4
5
|
|
5
6
|
require_relative 'tunes/tunes_client'
|
6
7
|
|
7
8
|
module Spaceship
|
8
9
|
class SpaceauthRunner
|
9
|
-
def initialize(username: nil)
|
10
|
+
def initialize(username: nil, copy_to_clipboard: nil)
|
10
11
|
@username = username
|
11
12
|
@username ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
|
12
13
|
@username ||= ask("Username: ")
|
14
|
+
@copy_to_clipboard = copy_to_clipboard
|
13
15
|
end
|
14
16
|
|
15
17
|
def run
|
@@ -22,7 +24,7 @@ module Spaceship
|
|
22
24
|
puts("Could not login to App Store Connect".red)
|
23
25
|
puts("Please check your credentials and try again.".yellow)
|
24
26
|
puts("This could be an issue with App Store Connect,".yellow)
|
25
|
-
puts("Please try unsetting the FASTLANE_SESSION environment variable".yellow)
|
27
|
+
puts("Please try unsetting the FASTLANE_SESSION environment variable by calling 'unset FASTLANE_SESSION'".yellow)
|
26
28
|
puts("(if it is set) and re-run `fastlane spaceauth`".yellow)
|
27
29
|
puts("")
|
28
30
|
puts("Exception type: #{ex.class}")
|
@@ -49,22 +51,30 @@ module Spaceship
|
|
49
51
|
cookie.name.start_with?("myacinfo") || cookie.name == "dqsid" || cookie.name.start_with?("DES")
|
50
52
|
end
|
51
53
|
|
52
|
-
yaml = cookies.to_yaml.gsub("\n", "\\n")
|
54
|
+
@yaml = cookies.to_yaml.gsub("\n", "\\n")
|
53
55
|
|
54
56
|
puts("---")
|
55
57
|
puts("")
|
56
58
|
puts("Pass the following via the FASTLANE_SESSION environment variable:")
|
57
|
-
puts(yaml.cyan.underline)
|
59
|
+
puts(@yaml.cyan.underline)
|
58
60
|
puts("")
|
59
61
|
puts("")
|
60
62
|
puts("Example:")
|
61
|
-
puts("export FASTLANE_SESSION='#{yaml}'".cyan.underline)
|
63
|
+
puts("export FASTLANE_SESSION='#{@yaml}'".cyan.underline)
|
62
64
|
|
63
|
-
if
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
if @copy_to_clipboard == false
|
66
|
+
puts("Skipped asking to copy the session string into your clipboard ⏭️".green)
|
67
|
+
elsif @copy_to_clipboard || (mac? && Spaceship::Client::UserInterface.interactive? && agree("🙄 Should fastlane copy the cookie into your clipboard, so you can easily paste it? (y/n)", true))
|
68
|
+
FastlaneCore::Clipboard.copy(content: @yaml)
|
69
|
+
puts("Successfully copied the session string into your clipboard 🎨".green)
|
67
70
|
end
|
71
|
+
|
72
|
+
return self
|
73
|
+
end
|
74
|
+
|
75
|
+
def session_string
|
76
|
+
FastlaneCore::UI.user_error!("`#{__method__}` method called before calling `run` in `SpaceauthRunner`") unless @yaml
|
77
|
+
@yaml
|
68
78
|
end
|
69
79
|
|
70
80
|
def mac?
|
@@ -18,10 +18,10 @@ module Spaceship
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# Public getter for all UI related code
|
21
|
-
# rubocop:disable
|
21
|
+
# rubocop:disable Naming/MethodName
|
22
22
|
def UI
|
23
23
|
UserInterface.new(self)
|
24
24
|
end
|
25
|
-
# rubocop:enable
|
25
|
+
# rubocop:enable Naming/MethodName
|
26
26
|
end
|
27
27
|
end
|
data/supply/lib/supply/client.rb
CHANGED
@@ -327,12 +327,14 @@ module Supply
|
|
327
327
|
def upload_mapping(path_to_mapping, apk_version_code)
|
328
328
|
ensure_active_edit!
|
329
329
|
|
330
|
+
extension = File.extname(path_to_mapping).downcase
|
331
|
+
|
330
332
|
call_google_api do
|
331
333
|
client.upload_edit_deobfuscationfile(
|
332
334
|
current_package_name,
|
333
335
|
current_edit.id,
|
334
336
|
apk_version_code,
|
335
|
-
"proguard",
|
337
|
+
extension == ".zip" ? "nativeCode" : "proguard",
|
336
338
|
upload_source: path_to_mapping,
|
337
339
|
content_type: "application/octet-stream"
|
338
340
|
)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "commander"
|
2
2
|
require "fastlane_core"
|
3
|
+
require 'fastlane_core/ui/help_formatter'
|
3
4
|
require "supply"
|
4
5
|
|
5
6
|
HighLine.track_eof = false
|
@@ -19,7 +20,7 @@ module Supply
|
|
19
20
|
program :help, 'Author', 'Felix Krause <supply@krausefx.com>'
|
20
21
|
program :help, 'Website', 'https://fastlane.tools'
|
21
22
|
program :help, 'Documentation', 'https://docs.fastlane.tools/actions/supply/'
|
22
|
-
program :help_formatter,
|
23
|
+
program :help_formatter, FastlaneCore::HelpFormatter
|
23
24
|
|
24
25
|
always_trace!
|
25
26
|
|
@@ -223,7 +223,7 @@ module Supply
|
|
223
223
|
default_value: false),
|
224
224
|
FastlaneCore::ConfigItem.new(key: :mapping,
|
225
225
|
env_name: "SUPPLY_MAPPING",
|
226
|
-
description: "Path to the mapping file to upload",
|
226
|
+
description: "Path to the mapping file to upload (mapping.txt or native-debug-symbols.zip alike)",
|
227
227
|
short_option: "-d",
|
228
228
|
conflicting_options: [:mapping_paths],
|
229
229
|
optional: true,
|
@@ -235,7 +235,7 @@ module Supply
|
|
235
235
|
conflicting_options: [:mapping],
|
236
236
|
optional: true,
|
237
237
|
type: Array,
|
238
|
-
description: "An array of paths to mapping files to upload",
|
238
|
+
description: "An array of paths to mapping files to upload (mapping.txt or native-debug-symbols.zip alike)",
|
239
239
|
short_option: "-s",
|
240
240
|
verify_block: proc do |value|
|
241
241
|
UI.user_error!("Could not evaluate array from '#{value}'") unless value.kind_of?(Array)
|
@@ -304,6 +304,7 @@ module Supply
|
|
304
304
|
mapping_paths = [Supply.config[:mapping]] unless (mapping_paths = Supply.config[:mapping_paths])
|
305
305
|
mapping_paths.zip(apk_version_codes).each do |mapping_path, version_code|
|
306
306
|
if mapping_path
|
307
|
+
UI.message("Preparing mapping at path '#{mapping_path}', version code #{version_code} for upload...")
|
307
308
|
client.upload_mapping(mapping_path, version_code)
|
308
309
|
end
|
309
310
|
end
|