diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 8068d53..66de1b8 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -30,42 +30,40 @@ gradle(task: "clean assemble") end - desc "Tag as a new version" - lane :tag do + desc "Bump version code/build number" + private_lane :bump do increment_version_code( - #code_num: 9, var_name: "versionCode|versionBuild", - #var_name: "AI_VERSION_CODE", - #file: "app/version.properties", verbose: true, ) - commit_android_version_bump( - message: "Increment version for new tag" + end + + desc "Tag as a new version" + private_lane :tag do + git_commit( + path: "app/build.gradle", + message: "Increment version code to #{lane_context[SharedValues::VERSION_CODE]} new tag", ) + add_git_tag( + tag: "#{lane_context[SharedValues::VERSION_CODE]}-{ENV['VERSION']}", + message: "Create new tag for version #{lane_context[SharedValues::VERSION_CODE]} (#{ENV['VERSION']})", + ) + push_to_git_remote + push_git_tags end desc "Build and deploy the apk for Alpha testing in Google Play store" lane :deploy_alpha do + bump gradle( task: "clean assemble", build_type: 'Release', -# properties: { -# 'versionCode' => 7, -# 'versionName' => "0.0.1.7" -# } ) supply( apk: 'app/build/outputs/apk/app-release.apk', - track: 'alpha' + track: 'alpha', ) - # Now tag the current released app -# tag_svn_url = sh("printf #{ENV['SVN_URL']} | sed 's@trunk@tags/build_#{version}-#{build_number}@' | tr -d '\n'") -# tag_svn_message = "Release build " + version + "-" + build_number -# sh("svn copy #{ENV['SVN_URL']} #{tag_svn_url} -m '#{tag_svn_message}'") - # Revert the local changes (badge changes should NOT be committed) -# sh("cd .. && svn revert -R .") - # Increase the build number to be committed. - + tag end desc "Submit a new Beta Build to Crashlytics Beta" @@ -79,8 +77,8 @@ desc "Deploy a new version to the Google Play" lane :deploy do - gradle(task: "assembleRelease") - supply + #gradle(task: "assembleRelease") + #supply end # You can define as many lanes as you want