diff --git a/.github/workflows/AppStore.yml b/.github/workflows/AppStore.yml index 29fe1c7d..dbb4a2a2 100644 --- a/.github/workflows/AppStore.yml +++ b/.github/workflows/AppStore.yml @@ -15,15 +15,22 @@ env: ENCRYPTED_XCCONFIG_PATH: ${{ 'XCConfig.zip.gpg' }} DECRYPTED_XCCONFIG_PATH: ${{ 'XCConfig' }} + PROVISION_SECRET: ${{ secrets.PROVISION_SECRET }} ENCRYPTED_PROVISION_PATH: ${{ 'Tuist/Signing/Dotori.PROD.mobileprovision.gpg' }} DECRYPTED_PROVISION_PATH: ${{ 'Tuist/Signing/Dotori.PROD.mobileprovision' }} + MASTER_KEY_SECRET: ${{ secrets.MASTER_KEY_SECRET }} ENCRYPTED_MASTER_KEY_PATH: ${{ 'Tuist/master.key.gpg' }} DECRYPTED_MASTER_KEY_PATH: ${{ 'Tuist/master.key' }} + FASTLANE_SECRET: ${{ secrets.FASTLANE_SECRET }} ENCRYPTED_FASTLANE_ENV_PATH: ${{ 'fastlane/.env.default.gpg' }} DECRYPTED_FASTLANE_ENV_PATH: ${{ 'fastlane/.env.default' }} + APPSTORE_CONNECT_SECRET: ${{ secrets.APPSTORE_CONNECT_SECRET }} + ENCRYPTED_APPSTORE_CONNECT_PATH: ${{ 'fastlane/AppStoreAPIKey.json.gpg' }} + DECRYPTED_APPSTORE_CONNECT_PATH: ${{ 'fastlane/AppStoreAPIKey.json' }} + jobs: distribute: name: πŸš€ App Store Submission @@ -40,13 +47,32 @@ jobs: unzip XCConfig.zip # Provisioning Profile - gpg -d -o "$DECRYPTED_PROVISION_PATH" --pinentry-mode=loopback --passphrase "$XCCONFIG_SECRET" "$ENCRYPTED_PROVISION_PATH" + gpg -d -o "$DECRYPTED_PROVISION_PATH" --pinentry-mode=loopback --passphrase "$PROVISION_SECRET" "$ENCRYPTED_PROVISION_PATH" # master.key - gpg -d -o "$DECRYPTED_MASTER_KEY_PATH" --pinentry-mode=loopback --passphrase "$XCCONFIG_SECRET" "$ENCRYPTED_MASTER_KEY_PATH" + gpg -d -o "$DECRYPTED_MASTER_KEY_PATH" --pinentry-mode=loopback --passphrase "$MASTER_KEY_SECRET" "$ENCRYPTED_MASTER_KEY_PATH" # fastlane env - gpg -d -o "$DECRYPTED_FASTLANE_ENV_PATH" --pinentry-mode=loopback --passphrase "$XCCONFIG_SECRET" "$ENCRYPTED_FASTLANE_ENV_PATH" + gpg -d -o "$DECRYPTED_FASTLANE_ENV_PATH" --pinentry-mode=loopback --passphrase "$FASTLANE_SECRET" "$ENCRYPTED_FASTLANE_ENV_PATH" + + # AppStore Connect API Key + gpg -d -o "$DECRYPTED_APPSTORE_CONNECT_PATH" --pinentry-mode=loopback --passphrase "$APPSTORE_CONNECT_SECRET" "$ENCRYPTED_APPSTORE_CONNECT_PATH" + + - name: Install fastlane + run: brew install fastlane - name: Install tuist run: curl -Ls https://install.tuist.io | bash + + - name: Install dependencies + run: tuist fetch + + - name: Project generate + run: TUIST_ENV=CD tuist generate + + - name: Update Release Note + run: | + echo "${{ github.event.inputs.changed }}" > fastlane/metadata/ko/release_notes.txt + + - name: distribute + run: fastlane release version:"${{ github.event.inputs.version }}" diff --git a/.gitignore b/.gitignore index cd4a9069..b6cbef64 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ fastlane/screenshots/screenshots.html fastlane/test_output fastlane/FastlaneRunner .env.default +AppStoreAPIKey.json ### Git ### *.orig diff --git a/Makefile b/Makefile index a5491254..0391cb7c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ generate: ci_generate: tuist fetch - TUIST_CI=1 tuist generate + TUIST_ENV=CI tuist generate clean: rm -rf **/*.xcodeproj diff --git a/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift b/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift index 4cf10e73..4475defb 100644 --- a/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift +++ b/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift @@ -7,7 +7,6 @@ public struct ProjectEnvironment { public let deploymentTarget: DeploymentTarget public let platform: Platform public let baseSetting: SettingsDictionary - public let isCI: Bool } public let env = ProjectEnvironment( @@ -15,6 +14,5 @@ public let env = ProjectEnvironment( organizationName: "com.msg", deploymentTarget: .iOS(targetVersion: "15.0", devices: [.iphone, .ipad]), platform: .iOS, - baseSetting: [:], - isCI: (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1" ? true : false + baseSetting: [:] ) diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index 46294315..567eb00f 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -5,8 +5,6 @@ import Foundation import ProjectDescription import ProjectDescriptionHelpers -let isCI = (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1" ? true : false - let configurations: [Configuration] = .default let settings: Settings = @@ -16,7 +14,7 @@ let settings: Settings = defaultSettings: .recommended ) -let scripts: [TargetScript] = isCI ? [] : [.swiftFormat, .swiftLint] +let scripts: [TargetScript] = generateEnvironment.scripts let targets: [Target] = [ .init( diff --git a/Projects/App/Support/Info.plist b/Projects/App/Support/Info.plist index d622da8e..f7ff7179 100644 --- a/Projects/App/Support/Info.plist +++ b/Projects/App/Support/Info.plist @@ -4,10 +4,10 @@ AppIdentifierPrefix $(AppIdentifierPrefix) - CFBundleDisplayName - 도토리 CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + 도토리 CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -19,9 +19,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.1.0 + 1.1.1 CFBundleVersion - 1 + 6 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/Projects/Core/Networking/Project.swift b/Projects/Core/Networking/Project.swift index a6217a1e..984d866d 100644 --- a/Projects/Core/Networking/Project.swift +++ b/Projects/Core/Networking/Project.swift @@ -7,9 +7,7 @@ import ProjectDescriptionHelpers let name = ModulePaths.Core.Networking.rawValue -let isCI = (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1" ? true : false - -let configurations: [Configuration] = isCI ? +let configurations: [Configuration] = generateEnvironment == .ci ? .default : [ .debug(name: .dev, xcconfig: .relativeToXCConfig(type: .dev, name: name)), diff --git a/Projects/Domain/MealDomain/Project.swift b/Projects/Domain/MealDomain/Project.swift index f90ab956..36a2e10c 100644 --- a/Projects/Domain/MealDomain/Project.swift +++ b/Projects/Domain/MealDomain/Project.swift @@ -6,9 +6,7 @@ import ProjectDescriptionHelpers let name = ModulePaths.Domain.MealDomain.rawValue -let isCI = (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1" ? true : false - -let configurations: [Configuration] = isCI ? +let configurations: [Configuration] = generateEnvironment == .ci ? .default : [ .debug(name: .dev, xcconfig: .relativeToXCConfig(type: .dev, name: name)), diff --git a/Tuist/ProjectDescriptionHelpers/Enum/GenerateEnvironment.swift b/Tuist/ProjectDescriptionHelpers/Enum/GenerateEnvironment.swift new file mode 100644 index 00000000..dd0b0e4d --- /dev/null +++ b/Tuist/ProjectDescriptionHelpers/Enum/GenerateEnvironment.swift @@ -0,0 +1,24 @@ +import ConfigurationPlugin +import Foundation +import ProjectDescription + +public enum GenerateEnvironment: String { + case ci = "CI" + case cd = "CD" + case dev = "DEV" +} + +let environment = ProcessInfo.processInfo.environment["TUIST_ENV"] ?? "" +public let generateEnvironment = GenerateEnvironment(rawValue: environment) ?? .dev + +public extension GenerateEnvironment { + var scripts: [TargetScript] { + switch self { + case .ci, .cd: + return [] + + case .dev: + return [.swiftFormat, .swiftLint] + } + } +} diff --git a/Tuist/ProjectDescriptionHelpers/Project+Template.swift b/Tuist/ProjectDescriptionHelpers/Project+Template.swift index 52ddab2b..ccda9887 100644 --- a/Tuist/ProjectDescriptionHelpers/Project+Template.swift +++ b/Tuist/ProjectDescriptionHelpers/Project+Template.swift @@ -4,8 +4,6 @@ import EnvironmentPlugin import Foundation import ProjectDescription -let isCI = (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1" ? true : false - public enum MicroFeatureTarget { case interface case testing @@ -36,7 +34,7 @@ public extension Project { configurations: [Configuration] = [], resourceSynthesizers: [ResourceSynthesizer] = .default ) -> Project { - let scripts: [TargetScript] = isCI ? [] : [.swiftFormat, .swiftLint] + let scripts: [TargetScript] = generateEnvironment.scripts let ldFlagsSettings: SettingsDictionary = product == .framework ? ["OTHER_LDFLAGS": .string("$(inherited) -all_load")] : ["OTHER_LDFLAGS": .string("$(inherited)")] diff --git a/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift b/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift index 51f28502..9ac23311 100644 --- a/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift +++ b/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift @@ -37,7 +37,7 @@ public struct TargetSpec: Configurable { copyFiles: [CopyFilesAction]? = nil, headers: Headers? = nil, entitlements: Path? = nil, - scripts: [TargetScript] = env.isCI ? [] : [.swiftFormat, .swiftLint], + scripts: [TargetScript] = generateEnvironment.scripts, dependencies: [TargetDependency] = [], settings: Settings? = nil, coreDataModels: [CoreDataModel] = [], diff --git a/fastlane/AppStoreAPIKey.json.gpg b/fastlane/AppStoreAPIKey.json.gpg new file mode 100644 index 00000000..2530e2ed Binary files /dev/null and b/fastlane/AppStoreAPIKey.json.gpg differ diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7d027d42..0c3d03a2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -19,7 +19,9 @@ platform :ios do desc "Push a new release build to the App Store" lane :release do |options| version = options[:version] - set_info_plist_value(path: "./Projects/App/Support/Info.plist", key: "CFBundleVersion", value: version) + + build_number = get_info_plist_value(path: "./Projects/App/Support/Info.plist", key: "CFBundleVersion") + set_info_plist_value(path: "./Projects/App/Support/Info.plist", key: "CFBundleVersion", value: "#{build_number.to_i + 1}") set_info_plist_value(path: "./Projects/App/Support/Info.plist", key: "CFBundleShortVersionString", value: version) build_app(scheme: "Dotori-PROD") upload_to_app_store( @@ -27,12 +29,17 @@ platform :ios do submit_for_review: true, force: true, automatic_release: true, - skip_metadata: false + skip_metadata: false, + api_key_path: "fastlane/AppStoreAPIKey.json", + precheck_include_in_app_purchases: false, + submission_information: { + add_id_info_uses_idfa: false + } ) discord_notifier( - webhook_url: "https://", - title: "πŸš€ 도토리 iOS CD 성곡 πŸš€", - image_url: "https://github.com/Team-Ampersand/Dotori-iOS/assets/74440939/5bcfc67c-37b2-42f6-8cef-7b544b0a5606", + webhook_url: "https://discord.com/api/webhooks/1139535875546566686/HmyeqwRhRPcx6sQOLu7KTQD-RsNwBY-3G36f8sTizjx3FA1eiLuJgODcBVIEhG7gZb3z", + title: "πŸš€ 도토리 iOS CD 성곡", + thumbnail_url: "https://github.com/Team-Ampersand/Dotori-iOS/assets/74440939/5bcfc67c-37b2-42f6-8cef-7b544b0a5606", description: "도토리 iOS #{version}을 μ•±μŠ€ν† μ–΄μ— μ„±κ³΅μ μœΌλ‘œ λ°°ν¬ν•˜μ˜€μŠ΅λ‹ˆλ‹€ !" ) set_github_release( diff --git a/fastlane/README.md b/fastlane/README.md index c394d4de..87ffeb24 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -23,14 +23,6 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do Push a new release build to the App Store -### ios tt - -```sh -[bundle exec] fastlane ios tt -``` - - - ---- This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. diff --git a/fastlane/metadata/ko/release_notes.txt b/fastlane/metadata/ko/release_notes.txt index 5b503791..82a12200 100644 --- a/fastlane/metadata/ko/release_notes.txt +++ b/fastlane/metadata/ko/release_notes.txt @@ -1 +1 @@ -κ³΅μœ ν•˜κΈ° λ²„νŠΌμ„ λˆ„λ₯΄κ³  도토리 앱을 μ„ νƒν•΄μ„œ λ°”λ‘œ κΈ°μƒμŒμ•…μ„ μ‹ μ²­ν•  수 μžˆμŠ΅λ‹ˆλ‹€! +ν™ˆν™”λ©΄μ—μ„œ μž‘μ€ μ„±λŠ₯κ°œμ„ μ΄ μžˆμ—ˆμŠ΅λ‹ˆλ‹€. \ No newline at end of file diff --git a/graph.png b/graph.png index b9c4885b..118a1efe 100644 Binary files a/graph.png and b/graph.png differ