Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shafayathossain/3cea4bad6126c369d14125f84865374f to your computer and use it in GitHub Desktop.
Save shafayathossain/3cea4bad6126c369d14125f84865374f to your computer and use it in GitHub Desktop.
Responsible for fetching version code from play console and incrementing version code.
desc "Responsible for fetching version code from play console and incrementing version code."
lane :increment_version_code_in_project_gradle do
version_code_from_play_store_strings = google_play_track_version_codes(
package_name: PACKAGE_NAME, # PACKAGE_NAME is a global variable defined earlier
track: "production", # this can be alpha, beta etc.
json_key: PLAYSTORE_KEY_PATH,
)
version_code_from_play_store = version_code_from_play_store_strings[0].to_i
UPDATED_VERSION_CODE = version_code_from_play_store + 1
increment_version_code(
gradle_file_path: Dir.pwd + "/../app/build.gradle",
version_code: UPDATED_VERSION_CODE.to_i
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment