class Fastlane::Actions::ConnectedCertsAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 41
def self.authors
  ["Abgier Avraha"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 54
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :app_id,
                         description: "You app's bundle identifier",
                            optional: false,
                                type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 37
def self.description
  "App Store Connect API Certificates Module"
end
details() click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 49
def self.details
  # Optional:
  ""
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 63
def self.is_supported?(platform)
  [:ios].include?(platform)
end
return_value() click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 45
def self.return_value
  # If your method provides a return value, you can describe here what it does
end
run(params) click to toggle source
# File lib/fastlane/plugin/connected/actions/connected_certs_action.rb, line 8
def self.run(params)
  app_id = params.values[:app_id]

  if app_id == '*'
    UI.success("Successfully Downloaded Certificates!")
    return
  end
  app_store_connect = AppStoreConnect::Client.new

  # Download profiles
  UI.message("Downloading Provisioning Profiles for app: #{app_id}")
  profiles = Helper::CertsHelper.download_provisioning_profiles_for_app(app_store_connect, app_id)

  # Install profiles and profile certificates
  profiles.each do |profile|
    profile_name = profile['name']

    UI.message("Installing Provisioning Profile: #{profile_name}")
    installed_profile = Helper::CertsHelper.install_provisioning_profile(app_store_connect, profile)
    UI.success("Succesfully Installed Provisioning Profile: #{profile_name}")

    UI.message("Installing Certificates from Provisioning Profile: #{profile_name}")
    Helper::CertsHelper.install_certificates_from_provisioning_profile(app_store_connect, installed_profile)
    UI.success("Successfully Installed Certificates for Provisioning Profile: #{profile_name}\n")
  end

  UI.success("Action connected_certs completed successfully!")
end