@@ -1128,6 +1128,58 @@ def prepare_app_store_release!(version:, build_number:)
11281128 release_xcconfig
11291129end
11301130
1131+ def mobile_release_ref_script
1132+ File . join ( repo_root , "scripts" , "mobile-release-ref.ts" )
1133+ end
1134+
1135+ def release_git_sha
1136+ stdout , stderr , status = Open3 . capture3 ( "git" , "rev-parse" , "HEAD" , chdir : repo_root )
1137+ UI . user_error! ( "Unable to resolve release Git SHA: #{ stderr . strip } " ) unless status . success?
1138+ stdout . strip
1139+ end
1140+
1141+ def mobile_release_ref_command ( command , platform :, version :, build : nil , version_code : nil , sha : nil )
1142+ args = [
1143+ "node" ,
1144+ "--import" ,
1145+ "tsx" ,
1146+ mobile_release_ref_script ,
1147+ command ,
1148+ "--platform" ,
1149+ platform ,
1150+ "--version" ,
1151+ version ,
1152+ "--root" ,
1153+ repo_root ,
1154+ ]
1155+ args . push ( "--build" , build . to_s ) if build
1156+ args . push ( "--version-code" , version_code . to_s ) if version_code
1157+ args . push ( "--sha" , sha . to_s ) if sha
1158+ sh ( shell_join ( args ) )
1159+ end
1160+
1161+ def ensure_mobile_release_ref_available! ( platform :, version :, build : nil , version_code : nil , sha : nil )
1162+ mobile_release_ref_command (
1163+ "preflight" ,
1164+ platform : platform ,
1165+ version : version ,
1166+ build : build ,
1167+ version_code : version_code ,
1168+ sha : sha
1169+ )
1170+ end
1171+
1172+ def record_mobile_release_ref! ( platform :, version :, build : nil , version_code : nil , sha : nil )
1173+ mobile_release_ref_command (
1174+ "record" ,
1175+ platform : platform ,
1176+ version : version ,
1177+ build : build ,
1178+ version_code : version_code ,
1179+ sha : sha
1180+ )
1181+ end
1182+
11311183def validate_app_store_ipa! ( ipa_path )
11321184 script_path = File . join ( repo_root , "scripts" , "ios-validate-app-store-ipa.sh" )
11331185 sh ( shell_join ( [ "bash" , script_path , "--ipa" , ipa_path ] ) )
@@ -1309,15 +1361,22 @@ platform :ios do
13091361 UI . user_error! ( "Use `pnpm ios:release:upload`; direct Fastlane TestFlight upload is disabled." )
13101362 end
13111363
1364+ release_sha = release_git_sha
13121365 release_signing_check!
13131366 preserve_local_signing do
13141367 screenshots
13151368 end
1369+ context = prepare_app_store_context ( require_api_key : true )
1370+ ensure_mobile_release_ref_available! (
1371+ platform : "ios" ,
1372+ version : context [ :short_version ] ,
1373+ build : context [ :build_number ] ,
1374+ sha : release_sha
1375+ )
13161376 ENV [ "DELIVER_SCREENSHOTS" ] = "1"
13171377 ENV [ "DELIVER_RELEASE_NOTES" ] = "1"
13181378 metadata
13191379
1320- context = prepare_app_store_context ( require_api_key : true )
13211380 build = build_app_store_release ( context )
13221381
13231382 upload_to_testflight (
@@ -1326,6 +1385,12 @@ platform :ios do
13261385 skip_waiting_for_build_processing : true ,
13271386 uses_non_exempt_encryption : false
13281387 )
1388+ record_mobile_release_ref! (
1389+ platform : "ios" ,
1390+ version : build [ :short_version ] ,
1391+ build : build [ :build_number ] ,
1392+ sha : release_sha
1393+ )
13291394
13301395 UI . success ( "Uploaded iOS App Store build: version=#{ build [ :version ] } short=#{ build [ :short_version ] } build=#{ build [ :build_number ] } " )
13311396 UI . important ( "App Review submission remains manual in App Store Connect." )
0 commit comments