BlueWallet/ios/fastlane/Fastfile
Marcos Rodriguez Velez ca2a2134fb FIX: API key process
wip

wip

wip

wip

Update Fastfile

Update build-release-testflight-ipa.yml

Update Fastfile

wip

Update Fastfile

Update project.pbxproj

Update Fastfile

wip

Update Fastfile

Update Fastfile

Update Fastfile

wip

Update build-release-testflight-ipa.yml
2023-12-04 18:31:54 +00:00

137 lines
4.4 KiB
Ruby

platform :ios do
desc "Create a temporary keychain"
lane :create_temp_keychain do
UI.message("Creating a temporary keychain...")
create_keychain(
name: "temp_keychain",
password: ENV["KEYCHAIN_PASSWORD"],
default_keychain: true,
unlock: true,
timeout: 3600,
lock_when_sleeps: true
)
UI.message("Temporary keychain created successfully.")
end
desc "Synchronize certificates and provisioning profiles"
lane :setup_provisioning_profiles do
UI.message("Setting up provisioning profiles...")
target_to_app_identifier = {
'BlueWallet' => 'io.bluewallet.bluewallet',
'BlueWalletWatch' => 'io.bluewallet.bluewallet.watch',
'BlueWalletWatchExtension' => 'io.bluewallet.bluewallet.watch.extension',
'Stickers' => 'io.bluewallet.bluewallet.Stickers',
'MarketWidget' => 'io.bluewallet.bluewallet.MarketWidget'
}
target_to_app_identifier.each do |target, app_identifier|
match(
git_basic_authorization: ENV["MATCH_GIT_BASIC_AUTHORIZATION"],
git_url: ENV["GIT_URL"],
type: "appstore",
app_identifier: app_identifier,
team_id: ENV["ITC_TEAM_ID"],
team_name: ENV["ITC_TEAM_NAME"],
readonly: true,
keychain_name: "temp_keychain",
keychain_password: ENV["KEYCHAIN_PASSWORD"]
)
end
end
desc "Clear derived data"
lane :clear_derived_data_lane do
UI.message("Clearing derived data...")
clear_derived_data
end
desc "Increment build number"
lane :increment_build_number_lane do
UI.message("Incrementing build number to current timestamp...")
# Get current Unix timestamp
@new_build_number = Time.now.to_i.to_s
# Set the new build number
increment_build_number(
xcodeproj: "BlueWallet.xcodeproj",
build_number: @new_build_number
)
UI.message("Build number set to: #{@new_build_number}")
end
desc "Install CocoaPods dependencies"
lane :install_pods do
UI.message("Installing CocoaPods dependencies...")
cocoapods
end
desc "Build the application"
lane :build_app_lane do
UI.message("Building the application...")
build_app(
scheme: "BlueWallet",
workspace: "BlueWallet.xcworkspace",
export_method: "app-store",
include_bitcode: true,
configuration: "Release",
skip_profile_detection: true,
include_symbols: true,
export_team_id: ENV["ITC_TEAM_ID"],
export_options: {
signingStyle: "manual",
provisioningProfiles: {
'io.bluewallet.bluewallet' => 'match AppStore io.bluewallet.bluewallet',
'io.bluewallet.bluewallet.watch' => 'match AppStore io.bluewallet.bluewallet.watch',
'io.bluewallet.bluewallet.watch.extension' => 'match AppStore io.bluewallet.bluewallet.watch.extension',
'io.bluewallet.bluewallet.Stickers' => 'match AppStore io.bluewallet.bluewallet.Stickers',
'io.bluewallet.bluewallet.MarketWidget' => 'match AppStore io.bluewallet.bluewallet.MarketWidget'
}
},
xcargs: "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) VERBOSE_LOGGING=1'",
output_directory: "./build", # Directory where the IPA file will be stored
output_name: "BlueWallet_#{@new_build_number}.ipa", # Using the build number in the file name
buildlog_path: "./build_logs"
)
end
desc "Upload to TestFlight"
lane :upload_to_testflight_lane do
UI.message("Uploading to TestFlight...")
upload_to_testflight(api_key_path: "appstore_api_key.json", ipa: "./build/BlueWallet_#{@new_build_number}.ipa", skip_waiting_for_build_processing: true)
end
desc "Deploy to TestFlight"
lane :deploy do |options|
UI.message("Starting build process...")
# Update the WWDR certificate
update_wwdr_certificate
setup_app_store_connect_api_key
setup_provisioning_profiles
clear_derived_data_lane
increment_build_number_lane
unless File.directory?("Pods")
install_pods
end
build_app_lane
upload_to_testflight_lane
# Clean up and delete the temporary keychain
delete_keychain(name: "temp_keychain")
# Mark deployment as completed for the current commit
last_commit = last_git_commit
already_built_flag = ".already_built_#{last_commit[:sha]}"
File.write(already_built_flag, Time.now.to_s)
File.write("output_name.txt", "BlueWallet_#{@new_build_number}.ipa")
end
end