Compare commits

..

10 Commits

2 changed files with 25 additions and 35 deletions

View File

@ -7,12 +7,12 @@ module Fastlane
def self.run(params)
# Check from parameters
unless Helper::AndroidCdHelper.is_set(params[:from])
UI.user_error!("❌ Parameters from cannot be null")
raise ArgumentError, "❌ Parameters from cannot be null"
end
# Check destination parameters
unless Helper::AndroidCdHelper.is_set(params[:destination])
UI.user_error!("❌ Parameters destination cannot be null")
raise ArgumentError, "❌ Parameters destination cannot be null"
end
UI.message("⌛️ Promoting to Google Play Store from #{params[:from]} to #{params[:destination]}..")
@ -23,6 +23,7 @@ module Fastlane
# Upload the Android App Bundle to the Play Store
other_action.upload_to_play_store(
track: params[:from],
track_promote_to: params[:destination],
json_key: './service_account_key.json',
skip_upload_apk: true,
skip_upload_aab: true,
@ -32,6 +33,10 @@ module Fastlane
skip_upload_screenshots: true
)
# Delete artifacts files
artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json']
Helper::AndroidCdHelper.delete_artifacts(artifacts)
UI.success('🍺 Successfully promote appbundle to Google Play Store')
end

View File

@ -36,7 +36,7 @@ module Fastlane
Helper::IosCdHelper.check_required_fields(required_fields, creds.keys)
# Delete keychain if existing
if File.exist?(File.expand_path("~/Library/Keychains/#{name}-db"))
if File.exist?(File.expand_path("~/Library/Keychains/#{creds['temp_keychain_user']}-db"))
other_action.delete_keychain(
name: creds['temp_keychain_user'].to_s
)
@ -61,32 +61,6 @@ module Fastlane
)
UI.message("🍺 API Key formated")
last_testflight_build_number =
other_action.latest_testflight_build_number(
api_key: api_key,
team_id: creds['team_id'].to_s,
team_name: creds['team_name'].to_s,
platform: 'ios',
app_identifier: creds['developer_app_identifier'].to_s,
username: creds['username'].to_s
) + 1
# Increment build number for latest TestFlight build
other_action.increment_build_number(
build_number: last_testflight_build_number,
xcodeproj: "Runner.xcodeproj"
)
UI.message("🍺 Build number incremented")
# Install Cocoapods
other_action.cocoapods(
clean_install: true,
clean: true,
integrate: true,
podfile: "./Podfile"
)
UI.message("🍺 Pod got")
# Set up code signing using match
# Configures and runs `match` which manages code signing certificates and provisioning profiles for the project.
# The function takes the app's bundle identifier, an authorization token for the project's Git repository, and the name and password for a temporary keychain used to store the signing certificate.
@ -105,19 +79,30 @@ module Fastlane
git_url: creds['git_url'].to_s,
storage_mode: "git"
)
UI.message("🍺 App signed")
UI.message("🍺 Signing environment ready")
archive_path = "../build/ios/archive/Runner.xcarchive"
if File.exist?(archive_path)
UI.message("🍺 Archive built")
else
raise ArgumentError, "❌ Cannot build XCode archive"
end
# Build and export app using Gym
# Builds and packages an iOS app or framework for distribution to the App Store, TestFlight, or Enterprise distribution.
# Packages an iOS app or framework for distribution to the App Store, TestFlight, or Enterprise distribution.
other_action.gym(
configuration: "Release",
workspace: "Runner.xcworkspace",
archive_path: archive_path,
skip_build_archive: true,
export_method: "app-store",
export_team_id: creds['team_id'].to_s,
export_options: {
provisioningProfiles: creds['provisioning_profiles']
provisioningProfiles: creds['provisioning_profiles'],
signingCertificate: "Apple Distribution: Jagger & Lewis (8547YCHLVR)"
}
)
UI.message("🍺 App built")
# Upload build to App Store Connect using Pilot
other_action.pilot(
@ -128,7 +113,7 @@ module Fastlane
skip_submission: true,
distribute_external: false,
notify_external_testers: false,
ipa: "./Runner.ipa"
ipa: "./Runner.ipa",
)
# Delete keychain if existing
@ -163,7 +148,7 @@ module Fastlane
FastlaneCore::ConfigItem.new(key: :beta_type,
env_name: "IOS_CD_TEST_TYPE",
optional: false,
description: "Type of test (internal, external, production)")
description: "Type of test (internal, external, production)"),
]
end