fluffychat/android/fastlane/Fastfile

55 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-11-22 11:04:47 +01:00
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
update_fastlane
default_platform(:android)
platform :android do
lane :set_build_code_internal do
versions = google_play_track_version_codes(
track: "internal",
json_key: "./keys.json"
)
last_version = versions[0].to_i
Dir.chdir("../..") do
2021-09-24 14:59:17 +02:00
re = /version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*/i
2020-11-22 11:04:47 +01:00
config = File.read("./pubspec.yaml")
version_name = config.match(re).captures
2021-05-30 14:32:38 +02:00
subst = "version: #{version_name[0]}+#{last_version+2}"
2020-11-22 11:04:47 +01:00
result = config.gsub(re, subst)
File.open("./pubspec.yaml", 'w') { |file| file.write(result) }
end
end
lane :deploy_internal_test do
versions = google_play_track_version_codes(
track: "internal",
json_key: "./keys.json"
)
last_version = versions[0].to_i
upload_to_play_store(track: 'internal', aab: '../build/app/outputs/bundle/release/app-release.aab', version_code: "#{last_version+1}")
end
2021-12-05 09:13:23 +01:00
lane :deploy_candidate do
upload_to_play_store(track: 'internal', track_promote_to: "beta", deactivate_on_promote: false, skip_upload_changelogs: true)
end
2020-11-22 11:04:47 +01:00
lane :deploy_release do
2021-12-05 09:13:23 +01:00
upload_to_play_store(track: 'beta', track_promote_to: "production", deactivate_on_promote: false, skip_upload_changelogs: true)
2020-11-22 11:04:47 +01:00
end
2021-05-30 14:32:38 +02:00
end