mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-12-06 23:23:03 +09:00
* fix: keep TestFlight upload going while another build is in beta review * chore: drop cisco, asus, logitech, dropbox and speedtest from default SNI list * fix: keep safe area when screenshots are disallowed * chore: bump version
82 lines
2.2 KiB
Ruby
82 lines
2.2 KiB
Ruby
def cmake_cache_value(name)
|
|
File.read("../build/CMakeCache.txt")[/^#{name}:\w+=(.*)$/, 1]
|
|
end
|
|
|
|
def archive_build(app_platform, profile_platform)
|
|
app_identifier = cmake_cache_value("BUILD_IOS_APP_IDENTIFIER")
|
|
build_app(
|
|
project: "build/AmneziaVPN.xcodeproj",
|
|
scheme: "AmneziaVPN",
|
|
configuration: "Release",
|
|
export_method: "app-store",
|
|
export_options: {
|
|
signingStyle: "manual",
|
|
provisioningProfiles: {
|
|
app_identifier => cmake_cache_value("CLIENT_#{profile_platform}_PROVISIONING_PROFILE_SPECIFIER"),
|
|
"#{app_identifier}.network-extension" => cmake_cache_value("CLIENT_#{profile_platform}_NE_PROVISIONING_PROFILE_SPECIFIER")
|
|
}
|
|
},
|
|
output_directory: "build/#{app_platform}",
|
|
output_name: "AmneziaVPN"
|
|
)
|
|
end
|
|
|
|
def authorize_app_store_connect
|
|
key = ENV.fetch("APPSTORE_CONNECT_PRIVATE_KEY")
|
|
app_store_connect_api_key(
|
|
key_id: ENV.fetch("APPSTORE_CONNECT_KEY_ID"),
|
|
issuer_id: ENV.fetch("APPSTORE_CONNECT_ISSUER_ID"),
|
|
key_content: key,
|
|
is_key_content_base64: !key.include?("PRIVATE KEY")
|
|
)
|
|
end
|
|
|
|
def upload_to_external_testers(package)
|
|
authorize_app_store_connect
|
|
upload_to_testflight(
|
|
**package,
|
|
distribute_external: true,
|
|
groups: ["test-external"],
|
|
changelog: "Improve stability"
|
|
)
|
|
rescue Spaceship::UnexpectedResponse => e
|
|
raise unless e.message.include?("already in beta review")
|
|
UI.important(e.message)
|
|
end
|
|
|
|
platform :ios do
|
|
lane :archive do
|
|
archive_build("ios", "IOS")
|
|
end
|
|
|
|
lane :testflight_upload do
|
|
upload_to_external_testers(ipa: "build/ios/AmneziaVPN.ipa")
|
|
end
|
|
end
|
|
|
|
platform :mac do
|
|
lane :archive do
|
|
archive_build("osx", "MACOS")
|
|
end
|
|
|
|
lane :testflight_upload do
|
|
upload_to_external_testers(app_platform: "osx", pkg: "build/osx/AmneziaVPN.pkg")
|
|
end
|
|
end
|
|
|
|
platform :android do
|
|
lane :play_upload do
|
|
upload_to_play_store(
|
|
package_name: "org.amnezia.vpn",
|
|
track: "beta",
|
|
release_status: "draft",
|
|
aab_paths: Dir["../build/android/*_play.aab"].map { |path| File.expand_path(path) },
|
|
json_key_data: ENV.fetch("GOOGLE_PLAY_SERVICE_ACCOUNT_JSON"),
|
|
skip_upload_metadata: true,
|
|
skip_upload_changelogs: true,
|
|
skip_upload_images: true,
|
|
skip_upload_screenshots: true
|
|
)
|
|
end
|
|
end
|