From db4f4cfbedf50dee115811a7010676e128058666 Mon Sep 17 00:00:00 2001 From: Safari <91936941+Siwon-L@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:23:05 +0900 Subject: [PATCH] =?UTF-8?q?[D-0]=20Dev=20Scheme=20=EC=B6=94=EA=B0=80=20(#7?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add: dev scheme 추가 * add: fastfile Dev 업로드 추가 * feat: dev upload를 위해 workflows 수정 * chore: marketingVersion 1.2.1 -> 1.2.2 --- .github/workflows/main.yml | 16 +++++++++-- Projects/App/Project.swift | 22 +++++++++++++-- fastlane/Fastfile | 56 +++++++++++++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 752417f..c10b175 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: UploadTestFlight on: push: - branches: [ develop ] + branches: [ develop, main ] jobs: upload_testflight: @@ -56,7 +56,19 @@ jobs: - name: Tuist generate run: tuist generate - - run: fastlane tf + - name: upload TestFlight Prod + if: github.ref == 'refs/heads/main' + run: fastlane tf + env: + KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + FASTLANE_API_KEY_ID: ${{ secrets.FASTLANE_API_KEY_ID }} + FASTLANE_API_KEY_ISSUER_ID: ${{ secrets.FASTLANE_API_KEY_ISSUER_ID }} + SLACK_HOOK_URL: ${{ secrets.SLACK_HOOK_URL }} + + - name: upload TestFlight Dev + if: github.ref == 'refs/heads/develop' + run: fastlane tfd env: KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index 908fdd0..f8393aa 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -8,9 +8,9 @@ let project = Project( ), settings: .settings( base: .init() - .marketingVersion("1.2.1") + .marketingVersion("1.2.2") .swiftVersion("5.7") - .currentProjectVersion("10") + .currentProjectVersion("1") .appleGenericVersioningSystem(), configurations: [ .debug(name: .debug, xcconfig: "Resources/APIKey.xcconfig"), @@ -74,6 +74,24 @@ let project = Project( LaunchArgument(name: "-FIRDebugEnabled", isEnabled: true) ] ) + ], + schemes: [ + Scheme( + name: "Moneymong", + buildAction: BuildAction(targets: ["Moneymong"]), + runAction: .runAction(configuration: .debug), + archiveAction: .archiveAction(configuration: .release), + profileAction: .profileAction(configuration: .release), + analyzeAction: .analyzeAction(configuration: .debug) + ), + Scheme( + name: "Dev-Moneymong", + buildAction: BuildAction(targets: ["Moneymong"]), + runAction: .runAction(configuration: .debug), + archiveAction: .archiveAction(configuration: .debug), + profileAction: .profileAction(configuration: .debug), + analyzeAction: .analyzeAction(configuration: .debug) + ) ] ) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d9ac5ff..0630e9c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -80,7 +80,61 @@ platform :ios do fields: [ { title: "Scheme", - value: "Release", + value: "#{SCHEME}", + }, + { + title: "Build Number", + value: "#{new_build_number.to_s}", + } + ] + }, + success: true + ) + end + + # Dev 테스트 플라이트 업로드 + desc "Push to TestFlight" + lane :tfd do |options| + + ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" + + # 앱스토어 커넥트 키 연결 + app_store_connect_api_key( + key_id: "#{FASTLANE_API_KEY_ID}", + issuer_id: "#{FASTLANE_API_KEY_ISSUER_ID}", + key_filepath: "fastlane/AuthKey.p8" + ) + + new_build_number = latest_testflight_build_number + 1 + + increment_build_number( + build_number: new_build_number, + xcodeproj: "Projects/App/Moneymong.xcodeproj" + ) + + # ✅ 빌드 + build_app( + workspace: "#{APP_NAME}.xcworkspace", + scheme: "Dev-#{SCHEME}", + export_method: "app-store" + ) + + # ✅ 테스트 플라이트 업로드 + upload_to_testflight(skip_waiting_for_build_processing: true) + slack( + message: "⭐️ 테스트 플라이트 업로드 성공", + channel: "#알림-ios-배포", + slack_url: "#{SLACK_HOOK_URL}", + username: "대신 배포해주는 고양이", + icon_url: "https://avatars.githubusercontent.com/u/21079970?v=4", + payload: { + "Build Date" => Time.new.to_s, + }, + attachment_properties: { + fields: [ + { + title: "Scheme", + value: "Dev-#{SCHEME}", }, { title: "Build Number",