[PM-8985] Fetch all tags when checking out repo for build job (#3371)

This commit is contained in:
Patrick Honkonen 2024-06-27 17:15:17 -04:00 committed by GitHub
parent 0f838965fb
commit 82e2c82666
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -126,9 +126,11 @@ platform :android do
currentVersionName = buildConfigText.match(/versionName = "(.+)"/).captures[0]
if options[:versionName].nil? or options[:versionName].to_s.empty?
puts "Fetching latest tags from origin..."
`git fetch --prune --no-recurse-submodules --filter=tree:0 --depth=1 --tags origin`
puts "Getting latest version name from previous git tag..."
latestTag = `git tag --sort=committerdate --list | tail -1`
puts "Using previous tag (#{latestTag}) to calculate version name..."
latestTag = `git describe --tags $(git rev-list --tags --max-count=1)`.chomp()
puts "Using tag #{latestTag} to calculate version name..."
latestTag.slice!(0)
puts "Current version name resolved to #{latestTag}."