Files
plezy/android/fastlane/Fastfile
T

48 lines
1.6 KiB
Ruby
Raw Normal View History

2025-11-01 05:50:24 +01:00
require 'dotenv/load'
Dotenv.load("../../.env")
default_platform(:android)
platform :android do
desc "Build and deploy to Google Play Store"
lane :release do
# Get version from pubspec.yaml
2025-11-01 05:50:24 +01:00
pubspec_path = "#{ENV['PWD']}/../pubspec.yaml"
pubspec_content = File.read(pubspec_path)
version_match = pubspec_content.match(/version:\s*(.+)\+(\d+)/)
if version_match
version_name = version_match[1].strip
2025-11-01 05:50:24 +01:00
version_code = version_match[2].to_i
UI.message("Using version: #{version_name}+#{version_code}")
2025-11-01 05:50:24 +01:00
else
UI.user_error!("Could not extract version from pubspec.yaml")
2025-11-01 05:50:24 +01:00
end
2026-02-22 05:42:30 +01:00
debug_info_dir = "./build/debug-info/#{version_name}+#{version_code}"
# Build the Flutter app
sh("cd #{ENV['PWD']}/.. && flutter build appbundle --dart-define=ENABLE_IN_APP_REVIEW=true --obfuscate --split-debug-info=#{debug_info_dir}/aab")
2025-11-01 05:50:24 +01:00
upload_to_play_store(
track: "production",
release_status: "completed",
2025-11-01 05:50:24 +01:00
version_code: version_code,
aab: "../build/app/outputs/bundle/release/app-release.aab"
)
2026-02-20 09:58:03 +01:00
# Build split-per-ABI APKs for Amazon Appstore (doesn't accept AABs)
sh("cd #{ENV['PWD']}/.. && flutter build apk --release --split-per-abi --obfuscate --split-debug-info=#{debug_info_dir}/apk")
2026-02-20 09:58:03 +01:00
upload_to_amazon_appstore(
2026-02-20 09:58:03 +01:00
apk_paths: [
"../build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk",
"../build/app/outputs/flutter-apk/app-arm64-v8a-release.apk"
],
overwrite_upload: true,
2026-02-26 13:19:01 +01:00
overwrite_upload_mode: 'reuse',
changes_not_sent_for_review: true
)
2025-11-01 05:50:24 +01:00
end
end