-
Notifications
You must be signed in to change notification settings - Fork 0
[#225] 테스트플라이트 자동 배포가 실패하는 현상을 해결한다 #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8696137
6772079
d4fc32f
1822757
e8dc7d4
c02c960
0c61521
ae00be7
2ba7707
51c4b57
e4fef3f
34b6453
96ecc93
550568b
345eccb
47765c9
fe1a1e0
db8f37c
064633c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,39 @@ | ||
| XCODE_PROJ = "DevLog.xcodeproj" | ||
| APP_IDENTIFIER = "opfic.DevLog" | ||
| TARGET_NAME = "DevLog" | ||
|
|
||
| default_platform(:ios) | ||
|
|
||
| platform :ios do | ||
| private_lane :fetch_latest_testflight_build_number do |options| | ||
| require "spaceship" | ||
|
|
||
| apiKey = options[:api_key] | ||
| versionNumber = options[:version] | ||
|
|
||
| Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(**apiKey) | ||
|
|
||
| app = Spaceship::ConnectAPI::App.find(APP_IDENTIFIER) | ||
| UI.user_error!("Could not find app for #{APP_IDENTIFIER}") if app.nil? | ||
|
|
||
| filter = { | ||
| "state" => "PROCESSING,FAILED,COMPLETE", | ||
| "cfBundleShortVersionString" => versionNumber, | ||
| "platform" => Spaceship::ConnectAPI::Platform.map("ios") | ||
| } | ||
|
|
||
| build = Spaceship::ConnectAPI.get_build_uploads( | ||
| app_id: app.id, | ||
| filter: filter, | ||
| sort: "-uploadedDate", | ||
| limit: 1 | ||
| ).first | ||
|
|
||
| next 0 if build.nil? | ||
|
|
||
| next build.cf_build_version.to_i | ||
| end | ||
|
|
||
| private_lane :asc_api_key do | ||
| app_store_connect_api_key( | ||
| key_id: ENV["ASC_KEY_ID"], | ||
|
|
@@ -11,33 +44,72 @@ platform :ios do | |
| end | ||
|
|
||
| private_lane :build_for_store do | ||
| if ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"].to_s.strip.empty? | ||
| ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "30" | ||
| end | ||
|
|
||
| if ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"].to_s.strip.empty? | ||
| ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "5" | ||
| end | ||
|
Comment on lines
+47
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| api_key = asc_api_key | ||
|
|
||
| versionNumber = get_version_number( | ||
| xcodeproj: XCODE_PROJ, | ||
| target: TARGET_NAME | ||
| ) | ||
|
|
||
| latestTestflightBuildNumber = fetch_latest_testflight_build_number( | ||
| api_key: api_key, | ||
| version: versionNumber | ||
| ) | ||
|
|
||
| setup_ci if ENV["CI"] | ||
|
|
||
| if ENV["GITHUB_RUN_NUMBER"] | ||
| increment_build_number( | ||
| xcodeproj: "DevLog.xcodeproj", | ||
| build_number: ENV["GITHUB_RUN_NUMBER"] | ||
| ) | ||
| end | ||
| increment_build_number( | ||
| xcodeproj: XCODE_PROJ, | ||
| build_number: latestTestflightBuildNumber + 1 | ||
| ) | ||
|
Comment on lines
+57
to
+72
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ruby 컨벤션에 따라 변수명에 스네이크 케이스(snake_case)를 사용하는 것이 좋습니다. |
||
|
|
||
| match( | ||
| api_key: api_key, | ||
| type: "development", | ||
| readonly: ENV["CI"] == "true" | ||
| ) | ||
|
|
||
| match( | ||
| api_key: api_key, | ||
| type: "appstore", | ||
| readonly: ENV["CI"] == "true" | ||
| ) | ||
|
|
||
| if ENV["CI"] == "true" | ||
| provisioningProfileSpecifier = lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING][APP_IDENTIFIER].to_s | ||
| UI.user_error!("Missing App Store provisioning profile mapping for #{APP_IDENTIFIER}") if provisioningProfileSpecifier.empty? | ||
|
|
||
| update_code_signing_settings( | ||
| use_automatic_signing: false, | ||
| path: XCODE_PROJ, | ||
| sdk: "iphoneos*", | ||
| team_id: ENV["APP_STORE_TEAM_ID"], | ||
| targets: [TARGET_NAME], | ||
| build_configurations: ["Release"], | ||
| code_sign_identity: "Apple Distribution", | ||
| profile_name: provisioningProfileSpecifier | ||
| ) | ||
|
Comment on lines
+87
to
+99
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ruby 컨벤션에 따라 변수명에 스네이크 케이스(snake_case)를 사용하는 것이 좋습니다. |
||
| end | ||
|
|
||
| build_app( | ||
| project: "DevLog.xcodeproj", | ||
| scheme: "DevLog", | ||
| export_method: "app-store" | ||
| project: XCODE_PROJ, | ||
| scheme: TARGET_NAME, | ||
| export_method: "app-store", | ||
| xcargs: "-skipPackagePluginValidation" | ||
| ) | ||
|
|
||
| next api_key | ||
| end | ||
|
|
||
| lane :beta do | ||
| lane :deploy_testflight do | ||
| api_key = build_for_store | ||
|
|
||
| upload_to_testflight( | ||
|
|
@@ -46,6 +118,10 @@ platform :ios do | |
| ) | ||
| end | ||
|
|
||
| lane :testflight_build_only do | ||
| build_for_store | ||
| end | ||
|
Comment on lines
+121
to
+123
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| lane :release do | ||
| api_key = build_for_store | ||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruby에서는 변수명에 스네이크 케이스(snake_case)를 사용하는 것이 일반적인 컨벤션입니다.
apiKey와versionNumber를 각각api_key와version_number로 변경하는 것을 제안합니다. 이렇게 하면 코드의 일관성과 가독성이 향상됩니다.