Skip to content

Commit

Permalink
automatic increment of version code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Panosfunk committed Sep 2, 2024
1 parent 91b32c3 commit 85ae8a3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ platform :android do
sh "flutter clean"
sh "flutter pub get"
sh "flutter pub upgrade"

pubspec_content = YAML.load_file("../pubspec.yaml")
# current_version_code = google_play_track_version_codes(track: 'internal')
version_string = pubspec_content['version']
version_parts = version_string.split('+')
if version_parts.size == 2
version_number = version_parts[1].to_i
new_version_number = version_number + 1
pubspec_content['version'] = "#{version_parts[0]}+#{new_version_number}"
else
UI.user_error!("Version string format is incorrect")
end
File.open(pubspec_path, 'w') { |f| f.write(pubspec_content.to_yaml) }

sh "flutter build appbundle --release --no-deferred-components --no-tree-shake-icons"
upload_to_play_store(
track: 'internal',
Expand Down

0 comments on commit 85ae8a3

Please sign in to comment.