diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml new file mode 100644 index 0000000..dca5719 --- /dev/null +++ b/.github/workflows/testflight.yml @@ -0,0 +1,64 @@ +name: 테스트 플라이트 배포 🚀 + +on: + push: + branches: + - main + +jobs: + build-upload-testflight: + runs-on: macos-15 + + steps: + - uses: actions/checkout@v4 + + - name: Set up SSH + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} + + - name: Set up RUBY + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + + # - name: Set up Xcode + # uses: maxim-lobanov/setup-xcode@v1.6.0 + # with: + # xcode-version: '16.2' + + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + + - name: Check Xcode version + run: xcodebuild -version + + - name: Install Bundler + run: gem install bundler + + - name: Install Fastlane + run: brew install fastlane + + - name: Check Fastlane + run: fastlane --version + + - name: Install Dependencies + run: bundle install + + - name: Upload to Testflight ✈️ + env: + APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY}} + 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 + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: ipa-and-dsym + path: | + ./Run\ Mile.ipa + ./Run\ Mile.app.dSYM.zip diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7a118b4 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..bb63134 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,227 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.7) + base64 + nkf + rexml + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + artifactory (3.0.17) + atomos (0.1.3) + aws-eventstream (1.4.0) + aws-partitions (1.1116.0) + aws-sdk-core (3.225.2) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + jmespath (~> 1, >= 1.6.1) + logger + aws-sdk-kms (1.105.0) + aws-sdk-core (~> 3, >= 3.225.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.189.1) + aws-sdk-core (~> 3, >= 3.225.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.12.1) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.3.0) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.7.0) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20240107) + dotenv (2.8.1) + emoji_regex (3.2.3) + excon (0.112.0) + faraday (1.10.4) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.1) + faraday (~> 1.0) + fastimage (2.4.0) + fastlane (2.228.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored (~> 1.2) + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (>= 0.1.1, < 1.0.0) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.5) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (~> 3) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.4.1) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-sirp (1.0.0) + sysrandom (~> 1.0) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.31.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.8.0) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.5.0) + google-cloud-storage (1.47.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.31.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.8.1) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.8) + domain_name (~> 0.5) + httpclient (2.9.0) + mutex_m + jmespath (1.6.2) + json (2.12.2) + jwt (2.10.1) + base64 + logger (1.7.0) + mini_magick (4.13.2) + mini_mime (1.1.5) + multi_json (1.15.0) + multipart-post (2.4.1) + mutex_m (0.3.0) + nanaimo (0.4.0) + naturally (2.3.0) + nkf (0.2.0) + optparse (0.6.0) + os (1.1.4) + plist (3.7.2) + public_suffix (6.0.2) + rake (13.3.0) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.4.1) + rouge (3.28.0) + ruby2_keywords (0.0.5) + rubyzip (2.4.1) + security (0.1.5) + signet (0.20.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.10) + CFPropertyList + naturally + sysrandom (1.0.5) + terminal-notifier (2.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unicode-display_width (2.6.0) + word_wrap (1.0.0) + xcodeproj (1.27.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) + xcpretty (0.4.1) + rouge (~> 3.28.0) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + arm64-darwin-24 + ruby + +DEPENDENCIES + fastlane + +BUNDLED WITH + 2.6.9 diff --git a/README.md b/README.md index 3dae04c..f58cffc 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ |상태|앱스토어 배포 완료 및 유지보수 진행 중(v1.0.0)| |:--|:--| -|기술 스택|SwiftUI, HealthKit, Realm, UserNotifications, Vision(이미지 배경 제거)| +|기술 스택|SwiftUI, HealthKit, Realm, Fastlane, UserNotifications, Vision(이미지 배경 제거)| |앱스토어|[Run Mile](https://apps.apple.com/kr/app/run-mile/id6747099791)| |이메일 문의|dlsqja567@naver.com| @@ -25,6 +25,7 @@ |**0. 사이드 프로젝트 Run Mile 앱 개발기**|https://velog.io/@mooninbeom/0.-사이드-프로젝트-Run-Mile-앱-개발기| |**1. HealthKit 데이터 사용(with Continuation)**|https://velog.io/@mooninbeom/1.-HealthKit-데이터-사용with-Continuation| |**2. 백그라운드에서 HealthKit 활용하기**|https://velog.io/@mooninbeom/2.-백그라운드에서-HealthKit-활용하기-o2p1gg9l| +|**3. Fastlane으로 Testflight 배포 자동화**|https://velog.io/@mooninbeom/3.-Fastlane으로-Testflight-배포-자동화|
diff --git a/Run Mile.xcodeproj/project.pbxproj b/Run Mile.xcodeproj/project.pbxproj index 0d85d63..9745616 100644 --- a/Run Mile.xcodeproj/project.pbxproj +++ b/Run Mile.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 2C079FBF2DB2505700B1EE0D /* RealmSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 2C079FBE2DB2505700B1EE0D /* RealmSwift */; }; 2C079FC02DB2507700B1EE0D /* RealmSwift in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 2C079FBE2DB2505700B1EE0D /* RealmSwift */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 2CE46E212DAE78D7008C6FBC /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 2CE46E202DAE78D7008C6FBC /* .gitignore */; }; - 2CF57F5C2DF9483100F59463 /* PrivacyPolicy.md in Resources */ = {isa = PBXBuildFile; fileRef = 2CF57F5B2DF9483100F59463 /* PrivacyPolicy.md */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -47,6 +46,9 @@ /* Begin PBXFileReference section */ 2C079A562DAF9F7F00B1EE0D /* Run_MileApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Run_MileApp.swift; sourceTree = ""; }; + 2C7633922E0049A30005D988 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 2C7635B02E0051AD0005D988 /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile; sourceTree = ""; }; + 2C7635B12E0051AD0005D988 /* Gemfile.lock */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile.lock; sourceTree = ""; }; 2CE46DF32DAE7780008C6FBC /* Run Mile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Run Mile.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2CE46E002DAE7782008C6FBC /* Run MileTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Run MileTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 2CE46E0A2DAE7782008C6FBC /* Run MileUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Run MileUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -55,6 +57,11 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ + 2C7635AF2E0051AD0005D988 /* fastlane */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = fastlane; + sourceTree = ""; + }; 2CE46DF52DAE7780008C6FBC /* Run Mile */ = { isa = PBXFileSystemSynchronizedRootGroup; path = "Run Mile"; @@ -101,6 +108,10 @@ 2CE46DEA2DAE7780008C6FBC = { isa = PBXGroup; children = ( + 2C7635AF2E0051AD0005D988 /* fastlane */, + 2C7635B02E0051AD0005D988 /* Gemfile */, + 2C7635B12E0051AD0005D988 /* Gemfile.lock */, + 2C7633922E0049A30005D988 /* README.md */, 2CF57F5B2DF9483100F59463 /* PrivacyPolicy.md */, 2C079A562DAF9F7F00B1EE0D /* Run_MileApp.swift */, 2CE46E202DAE78D7008C6FBC /* .gitignore */, @@ -246,7 +257,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2CF57F5C2DF9483100F59463 /* PrivacyPolicy.md in Resources */, 2CE46E212DAE78D7008C6FBC /* .gitignore in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -433,9 +443,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "Run Mile/Run Mile.entitlements"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 202506113; - DEVELOPMENT_TEAM = VF8R3A969C; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 202506231; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = VF8R3A969C; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "Run-Mile-Info.plist"; @@ -447,7 +460,7 @@ INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UIStatusBarStyle = ""; + INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UIUserInterfaceStyle = Dark; @@ -456,9 +469,11 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = "com.mooni.Run-Mile"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "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; @@ -475,9 +490,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "Run Mile/Run Mile.entitlements"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 202506113; - DEVELOPMENT_TEAM = VF8R3A969C; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 202506231; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = VF8R3A969C; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "Run-Mile-Info.plist"; @@ -489,7 +507,7 @@ INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UIStatusBarStyle = ""; + INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UIUserInterfaceStyle = Dark; @@ -498,9 +516,11 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = "com.mooni.Run-Mile"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "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; @@ -516,7 +536,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 202506231; DEVELOPMENT_TEAM = VF8R3A969C; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 18.4; @@ -535,7 +555,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 202506231; DEVELOPMENT_TEAM = VF8R3A969C; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 18.4; @@ -553,7 +573,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 202506231; DEVELOPMENT_TEAM = VF8R3A969C; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -570,7 +590,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 202506231; DEVELOPMENT_TEAM = VF8R3A969C; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -629,8 +649,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/realm/realm-swift.git"; requirement = { - branch = master; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 10.54.5; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/Run Mile/Helper/HealthKit+.swift b/Run Mile/Helper/HealthKit+.swift index 227bc6b..3d423f3 100644 --- a/Run Mile/Helper/HealthKit+.swift +++ b/Run Mile/Helper/HealthKit+.swift @@ -8,7 +8,7 @@ import HealthKit -extension HKHealthStore { +extension HKHealthStore: Sendable { public func fetchData( sampleType: HKSampleType, predicate: NSPredicate? = nil, diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 0000000..4ace4da --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,8 @@ +app_identifier("com.mooni.Run-Mile") # The bundle identifier of your app +apple_id("dlsqja567@naver.com") # Your Apple Developer Portal username + +itc_team_id("126391461") # App Store Connect Team ID +team_id("VF8R3A969C") # Developer Portal Team ID + +# For more information about the Appfile, see: +# https://docs.fastlane.tools/advanced/#appfile diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..da94af5 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,143 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + +default_platform(:ios) + +platform :ios do + lane :local do + app_store_connect_api_key( + key_id: "", + issuer_id: "", + key_content: "" + ) + + today = Time.now.strftime("%Y%m%d") + + current_build_number = "#{latest_testflight_build_number}" + + if current_build_number.length == 9 + current_date = current_build_number[0,8] # 앞 8자리가 날짜 + current_count = current_build_number[8].to_i # 마지막 1자리가 숫자 + else + # 빌드 넘버가 없거나 형식이 다르면 초기화 + current_date = "" + current_count = 0 + end + + if current_date == today + next_count = current_count + 1 + else + next_count = 1 + end + + new_build_number = "#{today}#{next_count}" + + increment_build_number( + xcodeproj: "Run Mile.xcodeproj", + build_number: new_build_number + ) + + match(type: "appstore") + + build_app( + scheme: "Run Mile", + xcodebuild_formatter: "xcpretty" + ) + + upload_to_testflight + end + + + desc "Push a new beta build to TestFlight" + lane :testflight do + + app_store_connect_api_key( + key_id: "#{ENV["APP_STORE_CONNECT_KEY_ID"]}", + issuer_id: "#{ENV["APP_STORE_CONNECT_ISSUER_ID"]}", + key_content: "#{ENV["APP_STORE_CONNECT_KEY"]}", + is_key_content_base64: true + ) + + today = Time.now.strftime("%Y%m%d") + + current_build_number = "#{latest_testflight_build_number}" + + if current_build_number.length == 9 + current_date = current_build_number[0,8] # 앞 8자리가 날짜 + current_count = current_build_number[8].to_i # 마지막 1자리가 숫자 + else + # 빌드 넘버가 없거나 형식이 다르면 초기화 + current_date = "" + current_count = 0 + end + + if current_date == today + next_count = current_count + 1 + else + next_count = 1 + end + + new_build_number = "#{today}#{next_count}" + + increment_build_number( + xcodeproj: "Run Mile.xcodeproj", + build_number: new_build_number + ) + + slack( + message: "Build Number: #{new_build_number} 배포 준비 시작", + channel: "#run_mile", + slack_url: "#{ENV["SLACK_URL"]}" + ) + + setup_ci + + match(type: "appstore") + + slack( + message: "Build Number: #{new_build_number} 인증서 준비 완료", + channel: "#run_mile", + slack_url: "#{ENV["SLACK_URL"]}" + ) + + build_app( + scheme: "Run Mile", + xcodebuild_formatter: "xcpretty" + ) + + slack( + message: "Build Number: #{new_build_number} 아카이브 완료", + channel: "#run_mile", + slack_url: "#{ENV["SLACK_URL"]}" + ) + + upload_to_testflight + + slack( + message: "Build Number: #{new_build_number} 배포 성공!", + channel: "#run_mile", + slack_url: "#{ENV["SLACK_URL"]}" + ) + end + + error do |lane, exception, options| + slack( + message: "Testflight 배포 중 오류가 발생했습니다. #{exception}", + channel: "#run_mile", + success: false, + slack_url: "#{ENV["SLACK_URL"]}" + ) + end +end diff --git a/fastlane/Matchfile b/fastlane/Matchfile new file mode 100644 index 0000000..3da1c80 --- /dev/null +++ b/fastlane/Matchfile @@ -0,0 +1,13 @@ +git_url("git@github.com:mooninbeom/fastlane-match.git") + +storage_mode("git") + +type("appstore") # The default type, can be: appstore, adhoc, enterprise or development + +app_identifier("com.mooni.Run-Mile") +username("dlsqja567@naver.com") # Your Apple Developer Portal username + +# For all available options run `fastlane match --help` +# Remove the # in the beginning of the line to enable the other options + +# The docs are available on https://docs.fastlane.tools/actions/match