Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions fastlane/common.Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ default_platform(:android)
ENV['SUPPLY_UPLOAD_MAX_RETRIES']='10'

platform :android do
# Usage: fastlane incrementVersion type:(major|minor|patch|rc|final)
# For major, minor, and patch: will increment that version number by 1 and set the smaller ones to 0
# For rc, final: will set build number to first rc/first final or increment it by 1
desc "Increment version code and version name"
lane :incrementVersion do |options|
versionInfo = getVersionInfo()
versionComponents = parseVersionCode(versionInfo)
newVersionComponents = incrementVersionComponents(versionComponents: versionComponents, type: options[:type])
versionNameGenerated = generateVersionName(newVersionComponents)
versionCodeGenerated = generateVersionCode(newVersionComponents)

promptYesNo(text: "Version code: #{versionInfo["versionCode"]} -> #{versionCodeGenerated}\n" +
"Version name: #{versionInfo["versionName"]} -> #{versionNameGenerated}"
)
writeVersions(versionCode: versionCodeGenerated, versionName: versionNameGenerated)
end

desc "Run tests and build app"
lane :releasePhase1 do
sh("rm -rf ../release/ && mkdir -p ../release")
Expand All @@ -45,6 +62,7 @@ platform :android do

desc "Release phase 2: checks, tag, create GH release, upload to appstores"
lane :releasePhase2 do
ensure_git_status_clean(show_uncommitted_changes: true)
versionInfo = getVersionInfo()
versionComponents = parseVersionCode(versionInfo)
checkReleasable(versionComponents)
Expand All @@ -71,23 +89,6 @@ platform :android do
print "Patch: #{versionComponents["patch"]}\n"
print "Build: #{versionComponents["build"]}\n"
end

# Usage: fastlane incrementVersion type:(major|minor|patch|rc|final)
# For major, minor, and patch: will increment that version number by 1 and set the smaller ones to 0
# For rc, final: will set build number to first rc/first final or increment it by 1
desc "Increment version code and version name"
lane :incrementVersion do |options|
versionInfo = getVersionInfo()
versionComponents = parseVersionCode(versionInfo)
newVersionComponents = incrementVersionComponents(versionComponents: versionComponents, type: options[:type])
versionNameGenerated = generateVersionName(newVersionComponents)
versionCodeGenerated = generateVersionCode(newVersionComponents)

promptYesNo(text: "Version code: #{versionInfo["versionCode"]} -> #{versionCodeGenerated}\n" +
"Version name: #{versionInfo["versionName"]} -> #{versionNameGenerated}"
)
writeVersions(versionCode: versionCodeGenerated, versionName: versionNameGenerated)
end

desc "Upload Alpha version to play store"
lane :uploadAlphaToPlayStore do |options|
Expand Down
Loading