Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha ad-hoc lane + workflow #2492

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions alphaAdhocExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>teamID</key>
<string>HKE973VLUW</string>
<key>method</key>
<string>ad-hoc</string>
<key>provisioningProfiles</key>
<dict>
<key>com.duckduckgo.mobile.ios.alpha</key>
<string>match AdHoc com.duckduckgo.mobile.ios.alpha</string>
<key>com.duckduckgo.mobile.ios.alpha.ShareExtension</key>
<string>match AdHoc com.duckduckgo.mobile.ios.alpha.ShareExtension</string>
<key>com.duckduckgo.mobile.ios.alpha.OpenAction2</key>
<string>match AdHoc com.duckduckgo.mobile.ios.alpha.OpenAction2</string>
<key>com.duckduckgo.mobile.ios.alpha.Widgets</key>
<string>match AdHoc com.duckduckgo.mobile.ios.alpha.Widgets</string>
<key>com.duckduckgo.mobile.ios.alpha.NetworkExtension</key>
<string>match AdHoc com.duckduckgo.mobile.ios.alpha.NetworkExtension</string>
</dict>
</dict>
</plist>
75 changes: 75 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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|

Expand Down Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions fastlane/Matchfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading