Skip to content

Commit

Permalink
refactor(tag fix)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Palmqvist <[email protected]>
  • Loading branch information
coolusername244 and PalmN72 committed Oct 30, 2023
1 parent ebaa2dd commit 62a4603
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/skolplattformen-app-new/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ android {
applicationId "com.oppna_skolplattformen_new.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2
versionCode 1
versionName "1.0"
}
signingConfigs {
Expand Down
12 changes: 8 additions & 4 deletions apps/skolplattformen-app-new/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ platform :android do
# versionNameOverride = "1.9.0"
if versionNameOverride.nil?
releaseNameSemVerArr = google_play_track_release_names(track: 'internal').max.split('.')
puts "releaseNameSemVerArr: #{releaseNameSemVerArr}"
# puts "hello there releaseNameSemVerArr: #{releaseNameSemVerArr}" # ["1 (1", "0)"]
releaseNameSemVerArr[2] = (releaseNameSemVerArr.last.to_i + 1).to_s
# puts "hello there releaseNameSemVerArr[2] #{releaseNameSemVerArr[2]}" # 1
ENV['VERSION_NAME'] = releaseNameSemVerArr.join('.')
# puts "hello there ENV['VERSION_NAME']: #{ENV['VERSION_NAME']}" # 1 (1.0).1
ENV['GITTAGNAME'] = ENV['VERSION_NAME'].gsub(/\s+/, '').match(/\((.*?)\)/)[1] + '.' + releaseNameSemVerArr[2]
# puts "hello there new version code: #{gitTagName}"
ENV['SUPPLY_VERSION_NAME'] = ENV['VERSION_NAME']
versionFile = File.join(Dir.pwd, '..', 'version', 'version.properties').to_s
commandargs = "-n \"VERSION=#{ENV['VERSION_NAME']}\" > #{versionFile}".to_s
Expand All @@ -36,7 +40,7 @@ platform :android do
end
puts "Compiling #{ENV['VERSION_NAME']} (#{ENV['VERSION_CODE']}) "


puts "hello there #{ENV['VERSION_NAME'].scan(/\d+(\.\d+)+/).join('.')}"
# Dir.pwd when running through Fastlane is app/android/fastlane
releaseFilePath = File.join(Dir.pwd, '..', 'app', "release.jks")
mappingFilePath = File.join(
Expand Down Expand Up @@ -95,14 +99,14 @@ platform :android do
system('git config user.email "[email protected]"')
system('git config user.name "Github Actions Android Pipeline"')

gitTagName = releaseNameSemVerArr.join('.').gsub(/[\s()]/, '')
# gitTagName = releaseNameSemVerArr.slice(releaseNameSemVerArr.indexOf("(")+1).replace(")", "")

add_git_tag(
grouping: "builds",
includes_lane: true,
# prefix: "v#{ENV['VERSION_NAME']}-",
# build_number: ENV['VERSION_CODE'],
tag: gitTagName
tag: "v#{ENV['GITTAGNAME']}"
)
push_to_git_remote(
tags: true
Expand Down

0 comments on commit 62a4603

Please sign in to comment.