diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index dca5719..89129bb 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -1,7 +1,9 @@ name: 테스트 플라이트 배포 🚀 on: - push: + # main 브랜치로 PR 시 테스트 플라이트 업로드 + # CD 성공 여부로 워크플로우 수정 진행 + pull_request: branches: - main @@ -26,10 +28,10 @@ jobs: # - name: Set up Xcode # uses: maxim-lobanov/setup-xcode@v1.6.0 # with: - # xcode-version: '16.2' + # xcode-version: '16.3' - name: Select Xcode version - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + run: sudo xcode-select -s /Applications/Xcode_16.3.app/Contents/Developer - name: Check Xcode version run: xcodebuild -version @@ -52,8 +54,8 @@ jobs: APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - SLACK_URL: ${{ secrets.SLACK_URL }} - run: bundle exec fastlane testflight + DISCORD_URL: ${{ secrets.DISCORD_URL }} + run: bundle exec fastlane upload_testflight - name: Upload Artifacts uses: actions/upload-artifact@v4 diff --git a/Gemfile b/Gemfile index 7a118b4..cdd3a6b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ source "https://rubygems.org" gem "fastlane" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index bb63134..6219db7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -37,9 +37,19 @@ GEM declarative (0.0.20) digest-crc (0.7.0) rake (>= 12.0.0, < 14.0.0) + discordrb (3.3.0) + discordrb-webhooks (~> 3.3.0) + ffi (>= 1.9.24) + opus-ruby + rbnacl (~> 3.4.0) + rest-client (>= 2.1.0.rc1) + websocket-client-simple (>= 0.3.0) + discordrb-webhooks (3.3.0) + rest-client (>= 2.1.0.rc1) domain_name (0.6.20240107) dotenv (2.8.1) emoji_regex (3.2.3) + event_emitter (0.2.6) excon (0.112.0) faraday (1.10.4) faraday-em_http (~> 1.0) @@ -112,8 +122,12 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.4.1) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-plugin-discord_notifier (0.1.7) + discordrb (~> 3.3.0) fastlane-sirp (1.0.0) sysrandom (~> 1.0) + ffi (1.17.2) + ffi (1.17.2-arm64-darwin) gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.54.0) google-apis-core (>= 0.11.0, < 2.a) @@ -152,6 +166,7 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) + http-accept (1.7.0) http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.9.0) @@ -161,6 +176,10 @@ GEM jwt (2.10.1) base64 logger (1.7.0) + mime-types (3.7.0) + logger + mime-types-data (~> 3.2025, >= 3.2025.0507) + mime-types-data (3.2025.0624) mini_magick (4.13.2) mini_mime (1.1.5) multi_json (1.15.0) @@ -168,16 +187,26 @@ GEM mutex_m (0.3.0) nanaimo (0.4.0) naturally (2.3.0) + netrc (0.11.0) nkf (0.2.0) optparse (0.6.0) + opus-ruby (1.0.1) + ffi os (1.1.4) plist (3.7.2) public_suffix (6.0.2) rake (13.3.0) + rbnacl (3.4.0) + ffi representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) retriable (3.1.2) rexml (3.4.1) rouge (3.28.0) @@ -203,6 +232,12 @@ GEM tty-cursor (~> 0.7) uber (0.1.0) unicode-display_width (2.6.0) + websocket (1.2.11) + websocket-client-simple (0.9.0) + base64 + event_emitter + mutex_m + websocket word_wrap (1.0.0) xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) @@ -222,6 +257,7 @@ PLATFORMS DEPENDENCIES fastlane + fastlane-plugin-discord_notifier BUNDLED WITH 2.6.9 diff --git a/Run Mile.xcodeproj/project.pbxproj b/Run Mile.xcodeproj/project.pbxproj index b09dae7..9745616 100644 --- a/Run Mile.xcodeproj/project.pbxproj +++ b/Run Mile.xcodeproj/project.pbxproj @@ -444,7 +444,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "Run Mile/Run Mile.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 202506231; DEVELOPMENT_TEAM = ""; @@ -473,7 +473,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.mooni.Run-Mile"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.mooni.Run-Mile"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.mooni.Run-Mile"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -491,7 +491,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "Run Mile/Run Mile.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 202506231; DEVELOPMENT_TEAM = ""; @@ -520,7 +520,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.mooni.Run-Mile"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.mooni.Run-Mile"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.mooni.Run-Mile"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; diff --git a/Run Mile/Presentation/2.Workout/WorkoutListView.swift b/Run Mile/Presentation/2.Workout/WorkoutListView.swift index 98ff086..3ee11c3 100644 --- a/Run Mile/Presentation/2.Workout/WorkoutListView.swift +++ b/Run Mile/Presentation/2.Workout/WorkoutListView.swift @@ -21,16 +21,20 @@ struct WorkoutListView: View { WorkoutNavigationView(viewModel: viewModel) switch viewModel.viewStatus { - case .none, .selection: + case .none, .selection, .loading: WorkoutScrollView(viewModel: $viewModel) - case .loading: - WorkoutLoadingView() case .empty: WorkoutEmptyView( viewModel: viewModel ) } } + .overlay { + if viewModel.viewStatus == .loading { + ProgressView() + .progressViewStyle(.circular) + } + } .task { await viewModel.onAppear() } @@ -119,18 +123,6 @@ private struct WorkoutScrollView: View { } -private struct WorkoutLoadingView: View { - var body: some View { - Group { - Spacer() - ProgressView() - .progressViewStyle(.circular) - Spacer() - } - } -} - - private struct WorkoutEmptyView: View { let viewModel: WorkoutListViewModel diff --git a/fastlane/Fastfile b/fastlane/Fastfile index da94af5..c7d44f2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -61,7 +61,7 @@ platform :ios do desc "Push a new beta build to TestFlight" - lane :testflight do + lane :upload_testflight do app_store_connect_api_key( key_id: "#{ENV["APP_STORE_CONNECT_KEY_ID"]}", @@ -96,20 +96,20 @@ platform :ios do build_number: new_build_number ) - slack( - message: "Build Number: #{new_build_number} 배포 준비 시작", - channel: "#run_mile", - slack_url: "#{ENV["SLACK_URL"]}" + discord_notifier( + webhook_url: "#{ENV["DISCORD_URL"]}", + title: "Run Mile 배포 준비", + description: "Build Number: #{new_build_number} 배포를 위해 준비중입니다." ) setup_ci match(type: "appstore") - slack( - message: "Build Number: #{new_build_number} 인증서 준비 완료", - channel: "#run_mile", - slack_url: "#{ENV["SLACK_URL"]}" + discord_notifier( + webhook_url: "#{ENV["DISCORD_URL"]}", + title: "Run Mile 인증서 완료", + description: "Build Number: #{new_build_number} 인증서 준비가 완료되었습니다." ) build_app( @@ -117,27 +117,26 @@ platform :ios do xcodebuild_formatter: "xcpretty" ) - slack( - message: "Build Number: #{new_build_number} 아카이브 완료", - channel: "#run_mile", - slack_url: "#{ENV["SLACK_URL"]}" + discord_notifier( + webhook_url: "#{ENV["DISCORD_URL"]}", + title: "Run Mile 아카이브 완료", + description: "Build Number: #{new_build_number} 아카이브가 완료되었습니다." ) upload_to_testflight - slack( - message: "Build Number: #{new_build_number} 배포 성공!", - channel: "#run_mile", - slack_url: "#{ENV["SLACK_URL"]}" + discord_notifier( + webhook_url: "#{ENV["DISCORD_URL"]}", + title: "Run Mile Testflight 배포 완료", + description: "Build Number: #{new_build_number} 테스트 플라이트 배포가 완료되었습니다." ) end error do |lane, exception, options| - slack( - message: "Testflight 배포 중 오류가 발생했습니다. #{exception}", - channel: "#run_mile", - success: false, - slack_url: "#{ENV["SLACK_URL"]}" + discord_notifier( + webhook_url: "#{ENV["DISCORD_URL"]}", + title: "Testflight 배포 중 오류가 발생했습니다.", + description: "에러 메시지\n#{exception}" ) end end diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile new file mode 100644 index 0000000..7ef2b02 --- /dev/null +++ b/fastlane/Pluginfile @@ -0,0 +1,5 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-discord_notifier'