Skip to content

Commit 015358a

Browse files
authored
[#225] 테스트플라이트 자동 배포가 실패하는 현상을 해결한다 (#232)
* style: 정확하게 테플이라는 이름 명시 * refactor: 앱 빌드 시간 단축 * chore: fastlane/README.md 추적 끄기 * test: lint 모듈 validation 스킵 * fix: 내부 testflight 이름과 겹치는 현상 수정 * fix: export_method 수정 * chore: 테스트플라이트 CI 배포 서명 설정 수정 * chore: 테스트플라이트 CI 서명 옵션 보정 * fix: fastlane 배포용 인증서 설치 흐름 수정 * feat: Apple Store Connect에 올라간 최신 빌드 번호 + 1 형태로 새 빌드 번호를 규정하도록 추가 * feat: 타깃의 Release 서명을 수동으로 고정
1 parent 2b68e80 commit 015358a

1 file changed

Lines changed: 37 additions & 18 deletions

File tree

fastlane/Fastfile

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,24 @@ platform :ios do
2323

2424
api_key = asc_api_key
2525

26+
versionNumber = get_version_number(
27+
xcodeproj: "DevLog.xcodeproj",
28+
target: "DevLog"
29+
)
30+
31+
latestTestflightBuildNumber = latest_testflight_build_number(
32+
api_key: api_key,
33+
app_identifier: "opfic.DevLog",
34+
version: versionNumber,
35+
initial_build_number: 0
36+
)
37+
2638
setup_ci if ENV["CI"]
2739

28-
if ENV["GITHUB_RUN_NUMBER"]
29-
increment_build_number(
30-
xcodeproj: "DevLog.xcodeproj",
31-
build_number: ENV["GITHUB_RUN_NUMBER"]
32-
)
33-
end
40+
increment_build_number(
41+
xcodeproj: "DevLog.xcodeproj",
42+
build_number: latestTestflightBuildNumber + 1
43+
)
3444

3545
match(
3646
api_key: api_key,
@@ -40,22 +50,31 @@ platform :ios do
4050

4151
match(
4252
api_key: api_key,
43-
type: "appstore",
53+
type: "development",
4454
readonly: ENV["CI"] == "true"
4555
)
4656

47-
matchProvisioningProfileMapping = lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING] || {}
48-
provisioningProfileSpecifier = matchProvisioningProfileMapping["opfic.DevLog"].to_s.strip
49-
50-
UI.user_error!("Missing provisioning profile mapping for opfic.DevLog") if provisioningProfileSpecifier.empty?
57+
match(
58+
api_key: api_key,
59+
type: "appstore",
60+
readonly: ENV["CI"] == "true"
61+
)
5162

52-
buildAppXcargs = [
53-
"-skipPackagePluginValidation",
54-
"CODE_SIGN_STYLE=Manual",
55-
"DEVELOPMENT_TEAM=#{ENV["APP_STORE_TEAM_ID"]}",
56-
"CODE_SIGN_IDENTITY=#{Shellwords.escape("Apple Distribution")}",
57-
"PROVISIONING_PROFILE_SPECIFIER=#{Shellwords.escape(provisioningProfileSpecifier)}"
58-
]
63+
if ENV["CI"] == "true"
64+
provisioningProfileSpecifier = lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING]["opfic.DevLog"].to_s
65+
UI.user_error!("Missing App Store provisioning profile mapping for opfic.DevLog") if provisioningProfileSpecifier.empty?
66+
67+
update_code_signing_settings(
68+
use_automatic_signing: false,
69+
path: "DevLog.xcodeproj",
70+
sdk: "iphoneos*",
71+
team_id: ENV["APP_STORE_TEAM_ID"],
72+
targets: ["DevLog"],
73+
build_configurations: ["Release"],
74+
code_sign_identity: "Apple Distribution",
75+
profile_name: provisioningProfileSpecifier
76+
)
77+
end
5978

6079
build_app(
6180
project: "DevLog.xcodeproj",

0 commit comments

Comments
 (0)