From 25917ca9bd3eefa36fc10501492f22ebb8501b61 Mon Sep 17 00:00:00 2001 From: opficdev Date: Tue, 14 Jul 2026 12:35:50 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20build=5Ffor=5Fstore=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=A1=B0=ED=9A=8C=20=EC=8B=A4=ED=8C=A8=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastlane/Fastfile | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c9061927..f3eca865 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -13,11 +13,40 @@ TESTFLIGHT_DATABASE_ID = "staging" APPSTORE_DATABASE_ID = "prod" TESTFLIGHT_FUNCTION_API_BASE_URL = "https://asia-northeast3-devlog-c87b6.cloudfunctions.net/stagingApi/api" APPSTORE_FUNCTION_API_BASE_URL = "https://asia-northeast3-devlog-c87b6.cloudfunctions.net/prodApi/api" +VERSION_XCCONFIG_PATH = "Application/Shared/Version.xcconfig" TESTFLIGHT_BUILD_OUTPUT_DIRECTORY = File.expand_path("testflight_build", __dir__) TESTFLIGHT_IPA_OUTPUT_PATH = File.join(TESTFLIGHT_BUILD_OUTPUT_DIRECTORY, "#{APP_PRODUCT_NAME}.ipa") APPSTORE_BUILD_OUTPUT_DIRECTORY = File.expand_path("appstore_build", __dir__) APPSTORE_IPA_OUTPUT_PATH = File.join(APPSTORE_BUILD_OUTPUT_DIRECTORY, "#{APP_PRODUCT_NAME}.ipa") +# xcconfig의 MARKETING_VERSION을 읽고 App Store 버전 형식을 검증한다. +def marketing_version_from_xcconfig(path) + expanded_path = File.expand_path(path) + UI.user_error!("Missing version configuration file: #{expanded_path}") if !File.file?(expanded_path) + + version_assignments = File.foreach(expanded_path).filter_map do |line| + assignment = line.match(/^\s*MARKETING_VERSION\s*=(.*)$/) + next if assignment.nil? + + assignment[1].sub(%r{\s*//.*$}, "").strip + end + + UI.user_error!("Missing MARKETING_VERSION in #{expanded_path}") if version_assignments.empty? + + version_number = version_assignments.last + UI.user_error!("Empty MARKETING_VERSION in #{expanded_path}") if version_number.empty? + + if !version_number.match?(/\A[1-9]\d*(?:\.\d+){0,2}\z/) + UI.user_error!( + "Invalid MARKETING_VERSION in #{expanded_path}: #{version_number.inspect}. Expected one to three dot-separated integers beginning with a positive integer." + ) + end + + version_number +rescue SystemCallError => error + UI.user_error!("Could not read version configuration file at #{expanded_path}: #{error.message}") +end + default_platform(:ios) platform :ios do @@ -182,10 +211,7 @@ platform :ios do api_key = asc_api_key - version_number = get_version_number( - xcodeproj: XCODE_PROJ, - target: TARGET_NAME - ) + version_number = marketing_version_from_xcconfig(VERSION_XCCONFIG_PATH) latest_build_number = fetch_latest_app_store_connect_build_number( api_key: api_key, From 0dbc07cf6a33f37e3c327128d71b0b2bd3903096 Mon Sep 17 00:00:00 2001 From: opficdev Date: Tue, 14 Jul 2026 13:53:19 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20Fastlane=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EA=B2=BD=EB=A1=9C=20=EA=B8=B0=EC=A4=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastlane/Fastfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index f3eca865..d3be9039 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -13,7 +13,10 @@ TESTFLIGHT_DATABASE_ID = "staging" APPSTORE_DATABASE_ID = "prod" TESTFLIGHT_FUNCTION_API_BASE_URL = "https://asia-northeast3-devlog-c87b6.cloudfunctions.net/stagingApi/api" APPSTORE_FUNCTION_API_BASE_URL = "https://asia-northeast3-devlog-c87b6.cloudfunctions.net/prodApi/api" -VERSION_XCCONFIG_PATH = "Application/Shared/Version.xcconfig" +VERSION_XCCONFIG_PATH = File.expand_path( + "../Application/Shared/Version.xcconfig", + __dir__ +) TESTFLIGHT_BUILD_OUTPUT_DIRECTORY = File.expand_path("testflight_build", __dir__) TESTFLIGHT_IPA_OUTPUT_PATH = File.join(TESTFLIGHT_BUILD_OUTPUT_DIRECTORY, "#{APP_PRODUCT_NAME}.ipa") APPSTORE_BUILD_OUTPUT_DIRECTORY = File.expand_path("appstore_build", __dir__)