Skip to content

Commit f3befc6

Browse files
fix (fastlane): use timestamp for build numbers
TestFlight API can return stale data when builds are processing, causing race conditions with sequential numbering. Timestamp format YYMMDDHHMM guarantees uniqueness and always increases (e.g., 2512181805 for Dec 18, 2025 18:05 UTC). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5a08d50 commit f3befc6

1 file changed

Lines changed: 6 additions & 23 deletions

File tree

fastlane/Fastfile

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,13 @@ def get_app_version
5555
end
5656
end
5757

58-
# Get the next unique build number for TestFlight
58+
# Get a unique build number using timestamp
59+
# This avoids race conditions with TestFlight API returning stale data
5960
def get_next_build_number
60-
key = api_key
61-
return 1 unless key
62-
63-
app_version = get_app_version
64-
UI.message("App version from Cargo.toml: #{app_version}")
65-
66-
# Get latest build number from TestFlight for this version
67-
begin
68-
latest_build = latest_testflight_build_number(
69-
api_key: key,
70-
app_identifier: APP_IDENTIFIER,
71-
version: app_version
72-
)
73-
UI.message("Latest TestFlight build number for v#{app_version}: #{latest_build}")
74-
rescue => e
75-
UI.message("No existing builds found for v#{app_version}, starting at 1")
76-
latest_build = 0
77-
end
78-
79-
new_build = latest_build + 1
80-
UI.message("New build number: #{new_build}")
81-
new_build
61+
# Format: YYMMDDHHMM (fits in 32-bit integer, always increasing)
62+
build_number = Time.now.utc.strftime("%y%m%d%H%M").to_i
63+
UI.message("Build number (timestamp): #{build_number}")
64+
build_number
8265
end
8366

8467
# Update tauri.conf.json with version from Cargo.toml and unique build number

0 commit comments

Comments
 (0)