Skip to content

Commit 4411ff9

Browse files
committed
[Setting] fastlane 버전별 빌드 번호 초기화 로직 추가
1 parent db28e19 commit 4411ff9

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

fastlane/Fastfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,47 @@ platform :ios do
44
desc "Release build and upload to App Store Connect"
55
lane :release do
66

7+
# 1. CI 환경 설정
78
setup_ci
89

10+
# 2. App Store Connect API 연결
911
app_store_connect_api_key(
1012
key_id: ENV["ASC_KEY_ID"],
1113
issuer_id: ENV["ASC_ISSUER_ID"],
1214
key_content: ENV["ASC_KEY_CONTENT"],
1315
is_key_content_base64: true
1416
)
1517

18+
# 3. 배포용 인증서 및 프로파일 동기화
1619
match(
1720
type: "appstore",
1821
readonly: true
1922
)
2023

24+
# 4. 버전별 빌드 번호 자동 관리 로직
25+
# 현재 Xcode 프로젝트에 설정된 버전(예: 1.2.0)을 가져옵니다.
26+
current_version = get_version_number(target: "Neki-iOS")
27+
28+
# 해당 버전에서 TestFlight에 올라간 가장 높은 빌드 번호를 확인합니다.
29+
# 만약 새 버전이라 데이터가 없다면 0을 반환합니다.
30+
latest_build = latest_testflight_build_number(
31+
version: current_version,
32+
initial_build_number: 0
33+
)
34+
35+
# 확인된 번호에 +1을 해서 로컬 프로젝트에 적용합니다.
2136
increment_build_number(
22-
build_number: latest_testflight_build_number + 1
37+
build_number: latest_build + 1
2338
)
2439

40+
# 5. 앱 빌드 및 아카이브
2541
build_app(
2642
scheme: "Neki-iOS",
2743
configuration: "Release",
2844
export_method: "app-store"
2945
)
3046

47+
# 6. TestFlight 업로드
3148
upload_to_app_store(
3249
skip_metadata: true,
3350
skip_screenshots: true,

0 commit comments

Comments
 (0)