mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +00:00
88 lines
2.5 KiB
Ruby
88 lines
2.5 KiB
Ruby
# This file contains the fastlane.tools configuration for Android
|
|
# 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
|
|
|
|
require 'json'
|
|
|
|
default_platform(:android)
|
|
|
|
current_version_code = 1
|
|
playstore_track = "internal"
|
|
package_json = JSON.parse(File.read('../../package.json'))
|
|
|
|
platform :android do
|
|
desc "Runs all the tests"
|
|
lane :test do
|
|
gradle(task: "test")
|
|
end
|
|
|
|
lane :fetch_version_code do
|
|
current_version_code = google_play_track_version_codes(
|
|
package_name: ENV['ANDROID_PACKAGE_NAME'],
|
|
track: playstore_track,
|
|
json_key: '../../playstore_api_key.json'
|
|
).max
|
|
end
|
|
|
|
lane :fetch_highest_version_code do
|
|
version_code_candidates = [1]
|
|
tracks = ['production', 'beta', 'internal']
|
|
tracks.each do |t|
|
|
version_code_candidates += google_play_track_version_codes(
|
|
package_name: ENV['ANDROID_PACKAGE_NAME'],
|
|
track: t,
|
|
json_key: '../../playstore_api_key.json'
|
|
)
|
|
end
|
|
current_version_code = version_code_candidates.compact.max
|
|
end
|
|
|
|
lane :build do
|
|
fetch_highest_version_code
|
|
gradle(
|
|
task: "clean assemble",
|
|
build_type: "Release",
|
|
print_command: false,
|
|
properties: {
|
|
"android.injected.signing.store.file" => "/build/playstore.keystore",
|
|
"android.injected.signing.store.password" => ENV['ANDROID_KEYSTORE_PASSWORD'],
|
|
"android.injected.signing.key.alias" => ENV['ANDROID_KEYSTORE_KEY_ALIAS'],
|
|
"android.injected.signing.key.password" => ENV['ANDROID_KEYSTORE_KEY_PASSWORD'],
|
|
"android.injected.version.code" => current_version_code + 1,
|
|
"android.injected.version.name" => package_json['version']
|
|
}
|
|
)
|
|
end
|
|
|
|
desc "Submit a new beta build to internal testing track"
|
|
lane :beta do
|
|
playstore_track = "internal"
|
|
|
|
build
|
|
upload_to_play_store(
|
|
track: playstore_track,
|
|
json_key: '../../playstore_api_key.json',
|
|
skip_upload_metadata: true,
|
|
skip_upload_images: true,
|
|
skip_upload_screenshots: true
|
|
)
|
|
end
|
|
|
|
desc "Deploy a new version to the Google Play"
|
|
lane :release do
|
|
build
|
|
#upload_to_play_store(json_key: '../../playstore_api_key.json', skip_upload_metadata: true, skip_upload_images: true)
|
|
end
|
|
end
|