diff --git a/alphaAdhocExportOptions.plist b/alphaAdhocExportOptions.plist new file mode 100644 index 0000000000..faed54b818 --- /dev/null +++ b/alphaAdhocExportOptions.plist @@ -0,0 +1,25 @@ + + + + + compileBitcode + + teamID + HKE973VLUW + method + ad-hoc + provisioningProfiles + + com.duckduckgo.mobile.ios.alpha + match AdHoc com.duckduckgo.mobile.ios.alpha + com.duckduckgo.mobile.ios.alpha.ShareExtension + match AdHoc com.duckduckgo.mobile.ios.alpha.ShareExtension + com.duckduckgo.mobile.ios.alpha.OpenAction2 + match AdHoc com.duckduckgo.mobile.ios.alpha.OpenAction2 + com.duckduckgo.mobile.ios.alpha.Widgets + match AdHoc com.duckduckgo.mobile.ios.alpha.Widgets + com.duckduckgo.mobile.ios.alpha.NetworkExtension + match AdHoc com.duckduckgo.mobile.ios.alpha.NetworkExtension + + + diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 751b5b0df9..a6abf0ade0 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -23,6 +23,11 @@ lane :sync_signing_alpha do |options| do_sync_signing(options) end +desc 'Fetches and updates certificates and provisioning profiles for Ad-Hoc distribution' +lane :sync_signing_alpha_adhoc do |options| + do_sync_signing(options) +end + desc 'Makes Ad-Hoc build with a specified name in a given directory' lane :adhoc do |options| @@ -90,6 +95,76 @@ lane :adhoc do |options| end end +desc 'Makes Ad-Hoc build for alpha with a specified name in a given directory' +lane :alpha_adhoc do |options| + + # Workaround for match + gym failing at build phase https://forums.swift.org/t/xcode-14-beta-code-signing-issues-when-spm-targets-include-resources/59685/32 + if is_ci + configurations = [ + { + targets: ["DuckDuckGo"], + profile_name: "match AdHoc com.duckduckgo.mobile.ios.alpha" + }, + { + targets: ["ShareExtension"], + profile_name: "match AdHoc com.duckduckgo.mobile.ios.alpha.ShareExtension" + }, + { + targets: ["OpenAction"], + profile_name: "match AdHoc com.duckduckgo.mobile.ios.alpha.OpenAction2" + }, + { + targets: ["WidgetsExtension"], + profile_name: "match AdHoc com.duckduckgo.mobile.ios.alpha.Widgets" + }, + { + targets: ["PacketTunnelProvider"], + profile_name: "match AdHoc com.duckduckgo.mobile.ios.alpha.NetworkExtension" + } + ] + + configurations.each do |config| + update_code_signing_settings( + use_automatic_signing: false, + build_configurations: ["Release"], + code_sign_identity: "iPhone Distribution", + **config + ) + end + end + + sync_signing_alpha(options) + sync_signing_alpha_adhoc(options) + + suffix = "" + if options[:suffix] + suffix = "#{options[:suffix]}-" + end + + timestamp = Time.now.strftime("%Y-%m-%d-%H-%M") + output_name = "DuckDuckGo-Alpha-#{suffix}#{timestamp}" + + + build_app( + output_directory: options[:output], + output_name: output_name, + export_method: "ad-hoc", + configuration: "Alpha", + scheme: "DuckDuckGo-Alpha", + export_options: "alphaAdhocExportOptions.plist", + derived_data_path: "DerivedData", + xcargs: "-skipPackagePluginValidation" + ) + + if is_ci + sh("echo output_name=#{output_name} >> $GITHUB_ENV") + end + + Dir.chdir("..") do + sh("open", "#{options[:output]}") unless is_ci + end +end + desc 'Makes App Store release build and uploads it to App Store Connect' lane :release_appstore do |options| build_release(options) diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 400b1ffebc..60bd4c4db9 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -13,11 +13,23 @@ for_lane :sync_signing_adhoc do force_for_new_devices true end +for_lane :sync_signing_alpha_adhoc do + type "adhoc" + app_identifier ["com.duckduckgo.mobile.ios.alpha", "com.duckduckgo.mobile.ios.alpha.ShareExtension", "com.duckduckgo.mobile.ios.alpha.OpenAction2", "com.duckduckgo.mobile.ios.alpha.Widgets", "com.duckduckgo.mobile.ios.alpha.NetworkExtension"] + force_for_new_devices true +end + for_lane :adhoc do type "adhoc" force_for_new_devices true end +for_lane :alpha_adhoc do + type "adhoc" + app_identifier ["com.duckduckgo.mobile.ios.alpha", "com.duckduckgo.mobile.ios.alpha.ShareExtension", "com.duckduckgo.mobile.ios.alpha.OpenAction2", "com.duckduckgo.mobile.ios.alpha.Widgets", "com.duckduckgo.mobile.ios.alpha.NetworkExtension"] + force_for_new_devices true +end + for_lane :sync_signing_alpha do app_identifier ["com.duckduckgo.mobile.ios.alpha", "com.duckduckgo.mobile.ios.alpha.ShareExtension", "com.duckduckgo.mobile.ios.alpha.OpenAction2", "com.duckduckgo.mobile.ios.alpha.Widgets", "com.duckduckgo.mobile.ios.alpha.NetworkExtension"] end diff --git a/fastlane/README.md b/fastlane/README.md index ebb133c3c9..36598490d2 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -37,6 +37,14 @@ Fetches and updates certificates and provisioning profiles for Ad-Hoc distributi Fetches and updates certificates and provisioning profiles for Alpha distribution +### sync_signing_alpha_adhoc + +```sh +[bundle exec] fastlane sync_signing_alpha_adhoc +``` + +Fetches and updates certificates and provisioning profiles for Ad-Hoc distribution + ### adhoc ```sh @@ -45,6 +53,14 @@ Fetches and updates certificates and provisioning profiles for Alpha distributio Makes Ad-Hoc build with a specified name in a given directory +### alpha_adhoc + +```sh +[bundle exec] fastlane alpha_adhoc +``` + +Makes Ad-Hoc build for alpha with a specified name in a given directory + ### release_appstore ```sh