Skip to content

Commit

Permalink
feat: add generation of Git tags in qualif build
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
  • Loading branch information
pylapp committed Feb 7, 2024
1 parent 581509e commit af1accf
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions OrangeDesignSystemDemo/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ platform :ios do
# ------------------------------------------------------------
desc "ADD APPS PLUS CREDENTIALS"
lane :add_credentials_appsplus do
if APPS_PLUS_SERVICE_URL.nil? || APPS_PLUS_SERVICE_URL.empty? {
publish_mattermost_notification("⚠️ @channel Warning: APPS_PLUS_SERVICE_URL is not defined, are you aware of that?")
}

update_plist(
plist_path: "OrangeDesignSystemDemo/Resources/Info.plist",
block: proc do |plist|
Expand Down Expand Up @@ -141,11 +145,11 @@ platform :ios do
# -----------------------------------------------------------------------
private_lane :build_and_upload do |options|
build

tag_build
if options[:upload]
upload
else
puts ">> Upload to testflight no requested"
puts "Upload to TestFlight no requested"
end
end

Expand Down Expand Up @@ -188,6 +192,33 @@ platform :ios do
end
end

# -----------------------------------------------------------------------
# PRIVATE LANE TO CREATE GIT TAG FOR CI
# -----------------------------------------------------------------------
#private_lane :tag_build do
lane :tag_build do
begin
version = get_app_version
timestamp = sh 'date +%s'
timestamp = timestamp.strip!
prefix = version + "-"

add_git_tag(
grouping: "qualif",
includes_lane: false,
prefix: prefix,
build_number: timestamp
)

expected_git_tag = "qualif/" + prefix + "/" + build_number

publish_mattermost_notification("📦 ✅ New Git tag created: '" + expected_git_tag + "'")
rescue => error
publish_mattermost_notification("📦 🚨 @channel Some issue occurred during the tagging step (:tag_build)")
raise error
end
end

# -----------------------------------------------------------------------
# PRIVATE LANE UPLOAD TO TESTFLIGHT (DEV / QUALIF / PROD is set by main lane)
# -----------------------------------------------------------------------
Expand Down Expand Up @@ -271,7 +302,7 @@ platform :ios do
)
end

puts "current relase notes = #{changelog}"
puts "Current relase notes = #{changelog}"
return changelog
end

Expand Down

0 comments on commit af1accf

Please sign in to comment.