Skip to content

Commit 794a550

Browse files
committed
[Fix] #265 - AppStore lane 구축
이제 명령어 한줄로도 심사 까지 연결 시킬 수 있습니다. 이는 기존대비 50% 이상 시간을 줄입니다.
1 parent d3ac4b7 commit 794a550

1 file changed

Lines changed: 119 additions & 44 deletions

File tree

Runnect-iOS/fastlane/Fastfile

Lines changed: 119 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,66 +21,141 @@ platform :ios do
2121
############# version #############
2222

2323

24-
desc "Set Marketing and Build version"
25-
lane :set_version do |version|
26-
increment_version_number(
27-
version_number: version[:version],
28-
xcodeproj: "./Runnect-iOS.xcodeproj"
29-
)
30-
24+
desc "Set Marketing and Build version"
25+
lane :set_version do |version|
26+
increment_version_number(
27+
version_number: version[:version],
28+
xcodeproj: "./Runnect-iOS.xcodeproj"
29+
)
30+
31+
increment_build_number(
32+
build_number: Time.new.strftime("%Y.%m%d.%H%M"), # 2023.0703.2100
33+
xcodeproj: "./Runnect-iOS.xcodeproj"
34+
)
35+
end
36+
37+
38+
39+
40+
41+
############# AppStore Release #############
42+
43+
desc "Build app and release to App Store."
44+
lane :release do |version|
45+
start_time = Time.now
46+
version = version[:version] # fastlane release version:2.0.3
47+
48+
match(
49+
type: "appstore",
50+
app_identifier: "com.runnect.Runnect-iOS",
51+
readonly: true
52+
)
53+
54+
if version
55+
puts "버전 정보: #{version}"
56+
set_version(version: version)
57+
else
58+
puts "버전 입력 X"
3159
increment_build_number(
32-
build_number: Time.new.strftime("%Y.%m%d.%H%M"), # 2023.0703.2100
60+
build_number: Time.new.strftime("%Y.%m%d.%H%M"),
3361
xcodeproj: "./Runnect-iOS.xcodeproj"
3462
)
3563
end
3664

37-
38-
############# beta #############
65+
build_app(
66+
workspace: "Runnect-iOS.xcworkspace",
67+
scheme: "Runnect-iOS",
68+
configuration: "Release"
69+
)
70+
71+
upload_to_app_store(
72+
app_version: version,
73+
submit_for_review: true, # 심사 제출은 자동(true)/수동(false)으로 진행
74+
force: true,
75+
automatic_release: true,
76+
skip_screenshots: true,
77+
skip_metadata: false, # true면 메타데이터 업로드 건너뛰기 <릴리즈 사진이나 기타 등등 데이터>
78+
submission_information: { add_id_info_uses_idfa: false }
79+
)
80+
81+
# ✅ Slack 설정.
82+
slack(
83+
message: "🍎AppStore 심사까지 성공했습니다!🍎",
84+
slack_url: ENV["RUNNECT_SLACK"],
85+
payload: { "Version": version }
86+
)
87+
88+
# ✅ 에러 처리.
89+
error do |lane, exception, options|
90+
slack(
91+
message: "에러 발생 : #{exception}",
92+
success: false,
93+
slack_url: ENV["RUNNECT_SLACK"]
94+
)
95+
end
3996

97+
end_time = Time.now
98+
elapsed_time = ((end_time - start_time) / 60).round(2)
99+
puts "fastlane.tools just completed your tasks in #{elapsed_time} minutes!🎉"
100+
end
40101

41-
desc "Push a new beta build to TestFlight"
42-
lane :beta do |version|
43-
version = version[:version]
44102

45-
match(
46-
type: "appstore",
47-
app_identifier: "com.runnect.Runnect-iOS",
48-
readonly: true
103+
104+
105+
106+
107+
############# beta #############
108+
109+
desc "Push a new beta build to TestFlight"
110+
lane :beta do |version|
111+
start_time = Time.now
112+
version = version[:version] # 버전 정보 추출
113+
114+
match(
115+
type: "appstore",
116+
app_identifier: "com.runnect.Runnect-iOS",
117+
readonly: true
118+
)
119+
120+
if version
121+
puts "버전 정보: #{version}"
122+
set_version(version: version)
123+
else
124+
puts "버전 입력 X"
125+
increment_build_number(
126+
build_number: Time.new.strftime("%Y.%m%d.%H%M"),
127+
xcodeproj: "./Runnect-iOS.xcodeproj"
49128
)
129+
end
50130

51-
if version
52-
puts "버전 정보: #{version}"
53-
set_version(version: version)
54-
else
55-
puts "버전 입력 X"
56-
increment_build_number(
57-
build_number: Time.new.strftime("%Y.%m%d.%H%M"),
58-
xcodeproj: "./Runnect-iOS.xcodeproj"
59-
)
60-
end
131+
build_app(workspace: "Runnect-iOS.xcworkspace", scheme: "Runnect-iOS")
61132

62-
build_app(workspace: "Runnect-iOS.xcworkspace", scheme: "Runnect-iOS")
133+
upload_to_testflight(skip_waiting_for_build_processing: true)
63134

64-
upload_to_testflight(skip_waiting_for_build_processing: true)
135+
# ✅ Slack 설정.
136+
slack(
137+
username: "이명진",
138+
message: "TestFlight 배포 성공.",
139+
icon_url: "https://is1-ssl.mzstatic.com/image/thumb/Purple116/v4/a6/68/d0/a668d049-8c1a-0e7b-19c3-287093c0a501/AppIcon-1x_U007emarketing-0-7-0-85-220.png/1024x1024bb.png",
140+
slack_url: ENV["RUNNECT_SLACK"],
141+
payload: { "Version": version }
142+
)
65143

66-
# ✅ Slack 설정.
144+
# ✅ 에러 처리.
145+
error do |lane, exception, options|
67146
slack(
68-
username: "이명진",
69-
message: "TestFlight 배포 성공.",
70-
icon_url: "https://is1-ssl.mzstatic.com/image/thumb/Purple116/v4/a6/68/d0/a668d049-8c1a-0e7b-19c3-287093c0a501/AppIcon-1x_U007emarketing-0-7-0-85-220.png/1024x1024bb.png",
71-
slack_url: ENV["RUNNECT_SLACK"],
72-
payload: { "Version": version }
147+
message: "에러 발생 : #{exception}",
148+
success: false,
149+
slack_url: ENV["RUNNECT_SLACK"]
73150
)
74-
# ✅ 에러 처리.
75-
error do |lane, exception, options|
76-
slack(
77-
message: "에러 발생 : #{exception}",
78-
success: false,
79-
slack_url: "https://hooks.slack.com/…"
80-
)
81-
end
82151
end
83152

153+
end_time = Time.now
154+
elapsed_time = ((end_time - start_time) / 60).round(2)
155+
puts "fastlane.tools just completed your tasks in #{elapsed_time} minutes!🎉"
156+
end
157+
158+
84159

85160

86161
############# Device Management #############
@@ -112,4 +187,4 @@ platform :ios do
112187
readonly: true
113188
)
114189
end
115-
end
190+
end

0 commit comments

Comments
 (0)