sigh/lib/sigh/runner.rb in fastlane_hotfix-2.165.1 vs sigh/lib/sigh/runner.rb in fastlane_hotfix-2.187.0
- old
+ new
@@ -15,14 +15,20 @@
def run
FastlaneCore::PrintTable.print_values(config: Sigh.config,
hide_keys: [:output_path],
title: "Summary for sigh #{Fastlane::VERSION}")
- if api_token
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: Sigh.config[:api_key], filepath: Sigh.config[:api_key_path]))
UI.message("Creating authorization token for App Store Connect API")
Spaceship::ConnectAPI.token = api_token
+ elsif !Spaceship::ConnectAPI.token.nil?
+ UI.message("Using existing authorization token for App Store Connect API")
else
+ # Username is now optional since addition of App Store Connect API Key
+ # Force asking for username to prompt user if not already set
+ Sigh.config.fetch(:username, force_ask: true)
+
# Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
# Prompts select team if multiple teams and none specified
UI.message("Starting login with user '#{Sigh.config[:username]}'")
Spaceship::ConnectAPI.login(Sigh.config[:username], nil, use_portal: true, use_tunes: false)
UI.message("Successfully logged in")
@@ -57,16 +63,10 @@
end
return download_profile(profile)
end
- def api_token
- @api_token ||= Spaceship::ConnectAPI::Token.create(Sigh.config[:api_key]) if Sigh.config[:api_key]
- @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Sigh.config[:api_key_path]) if Sigh.config[:api_key_path]
- return @api_token
- end
-
# The kind of provisioning profile we're interested in
def profile_type
return @profile_type if @profile_type
case Sigh.config[:platform]
@@ -280,11 +280,11 @@
[Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV]
when 'macos', 'catalyst'
[Spaceship::ConnectAPI::Device::DeviceClass::MAC]
end
- if api_token
+ if Spaceship::ConnectAPI.token
return Spaceship::ConnectAPI::Device.all.select do |device|
device_classes.include?(device.device_class)
end
else
filter = { deviceClass: device_classes.join(",") }
@@ -325,10 +325,10 @@
if certificates.count > 1 && !Sigh.config[:development]
UI.important("Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options.")
UI.important("Available Code Signing Identities for current filters:")
certificates.each do |c|
- str = ["\t- Name:", c.display_name, "- ID:", c.id + " - Expires", c.expires.strftime("%d/%m/%Y")].join(" ")
+ str = ["\t- Name:", c.display_name, "- ID:", c.id + " - Expires", Time.parse(c.expiration_date).strftime("%Y-%m-%d")].join(" ")
UI.message(str.green)
end
end
if certificates.count == 0