sigh/lib/sigh/runner.rb in fastlane-2.155.0 vs sigh/lib/sigh/runner.rb in fastlane-2.155.1
- old
+ new
@@ -169,11 +169,12 @@
profile = Spaceship::ConnectAPI::Profile.create(
name: name,
profile_type: profile_type,
bundle_id_id: bundle_id.id,
- certificate_ids: [certificate_to_use.id]
+ certificate_ids: certificates_to_use.map(&:id),
+ device_ids: devices_to_use.map(&:id)
)
profile
end
@@ -224,12 +225,31 @@
end
certificates
end
+ def devices_to_use
+ device_class = case Sigh.config[:platform].to_s
+ when 'ios'
+ [
+ Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
+ Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
+ Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
+ Spaceship::ConnectAPI::Device::DeviceClass::IPOD
+ ].join(",")
+ when 'tvos'
+ Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV
+ when 'macos', 'catalyst'
+ Spaceship::ConnectAPI::Device::DeviceClass::MAC
+ end
+
+ filter = { deviceClass: device_class }
+ return Spaceship::ConnectAPI::Device.all(filter: filter)
+ end
+
# Certificate to use based on the current distribution mode
- def certificate_to_use
+ def certificates_to_use
certificates = certificates_for_profile_and_platform
# Filter them
certificates = certificates.find_all do |c|
if Sigh.config[:cert_id]
@@ -275,10 +295,10 @@
message += "If you don't want to do so, you can also use cert to generate a new one: https://fastlane.tools/cert"
UI.user_error!(message)
end
return certificates if Sigh.config[:development] # development profiles support multiple certificates
- return certificates.first
+ return [certificates.first]
end
# Downloads and stores the provisioning profile
def download_profile(profile)
UI.important("Downloading provisioning profile...")