Skip to content

Instantly share code, notes, and snippets.

@jbcrestot
Created November 28, 2019 17:39
Show Gist options
  • Save jbcrestot/51234b70014ec6ddc2dbf0516e9ee1ca to your computer and use it in GitHub Desktop.
Save jbcrestot/51234b70014ec6ddc2dbf0516e9ee1ca to your computer and use it in GitHub Desktop.
fastfile for android
platform :android do
before_all do
skip_docs
end
desc "build an adhoc release for internal store"
lane :adhoc do
gradle
end
desc "Submit a new Internal Build to Google Play "
lane :beta do |options|
increment_version_code
gradle
puts 'call yarn build:incrementVersionCode android'
system "yarn build:incrementVersionCode android"
upload_to_play_store(
json_key: "android/build_android_account.json",
track: "internal"
)
end
desc "Return the highest version code between all play store tracks"
lane :getHighestVersionCodeOnStore do
highestVersionCode = []
internal = google_play_track_version_codes(
track: 'internal',
json_key: 'android/build_android_account.json'
)
unless internal.nil? || internal[0].nil?
highestVersionCode.push(internal[0])
end
alpha = google_play_track_version_codes(
track: 'alpha',
json_key: 'android/build_android_account.json'
)
unless alpha.nil? || alpha[0].nil?
highestVersionCode.push(alpha[0])
end
beta = google_play_track_version_codes(
track: 'beta',
json_key: 'android/build_android_account.json'
)
unless beta.nil? || beta[0].nil?
highestVersionCode.push(beta[0])
end
production = google_play_track_version_codes(
json_key: 'android/build_android_account.json'
)
unless production.nil? || production[0].nil?
highestVersionCode.push(production[0])
end
puts 'The highest version code retrieve on store is ' + highestVersionCode.max.to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment