Skip to content

Commit

Permalink
🔀 Merge branch 'ladislas/bugfix/build-number'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Sep 15, 2023
2 parents 4a1e997 + 093b215 commit 9bd95a5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,20 @@ platform :ios do
ENV.fetch('FASTLANE_KEYCHAIN_PASSWORD', nil), 'io.leka.fastlane.keychain')
end

latest_build_number = latest_testflight_build_number(app_identifier: app_id.to_s)
next_build_number = latest_build_number.split('.').first.to_i + 1
pr_number = ENV.fetch('PR_NUMBER', `gh pr view --json number -q .number`.strip)
last_commit_sha_hex = last_git_commit[:abbreviated_commit_hash].to_i(16)

build_number = "#{next_build_number}.#{pr_number or '000'}.#{last_commit_sha_hex}"
version_number = get_version_number(xcodeproj: app_xcodeproj.to_s)
pr_number = ENV.fetch('PR_NUMBER', nil)
last_commit_sha = last_git_commit[:abbreviated_commit_hash]
build_number = "pr:#{pr_number or 'none'}+#{last_commit_sha}"

UI.important "Version number: #{version_number} / Build number: #{build_number}"

increment_build_number(
build_number: build_number,
xcodeproj: app_xcodeproj.to_s
)

build_app(
workspace: 'ios-monorepo.xcworkspace',
Expand Down

0 comments on commit 9bd95a5

Please sign in to comment.