From cc832ec06825d454c65b99a5a36257072bf02adb Mon Sep 17 00:00:00 2001 From: nkhanh44 Date: Fri, 7 Apr 2023 15:33:32 +0700 Subject: [PATCH 01/56] [#426] Remove duplicate in PULL REQUEST TEMPLATE --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a5568f2a..00c49517 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ -- Close #https://github.com/nimblehq/ios-templates/issues/ +- Close # ## What happened 👀 From 0e8cd1677ff5b8f383c112ffb29208348fb1d3b4 Mon Sep 17 00:00:00 2001 From: nkhanh44 Date: Fri, 7 Apr 2023 17:20:28 +0700 Subject: [PATCH 02/56] [#463] Update actions version --- .github/workflows/automatic_pull_request_review.yml | 6 +++--- .github/workflows/deploy_app_store.yml | 8 ++++---- .github/workflows/deploy_production_firebase.yml | 8 ++++---- .github/workflows/deploy_staging_firebase.yml | 6 +++--- .github/workflows/test_install_script.yml | 2 +- .github/workflows/test_upload_build_to_test_flight.yml | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/automatic_pull_request_review.yml b/.github/workflows/automatic_pull_request_review.yml index 3f42072e..cd196981 100644 --- a/.github/workflows/automatic_pull_request_review.yml +++ b/.github/workflows/automatic_pull_request_review.yml @@ -13,11 +13,11 @@ jobs: name: Pull request review by Danger runs-on: macOS-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: bunlderCache with: path: vendor/bundle @@ -29,7 +29,7 @@ jobs: run: bundle install --path vendor/bundle - name: Cache Pods - uses: actions/cache@v2 + uses: actions/cache@v3 id: cocoapodCache with: path: Pods diff --git a/.github/workflows/deploy_app_store.yml b/.github/workflows/deploy_app_store.yml index 5bcb5663..3fc7756b 100644 --- a/.github/workflows/deploy_app_store.yml +++ b/.github/workflows/deploy_app_store.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -34,13 +34,13 @@ jobs: runs-on: macOS-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Set fetch-depth (default: 1) to get whole tree with: fetch-depth: 0 - name: Install SSH key - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} @@ -48,7 +48,7 @@ jobs: run: bundle install - name: Cache Pods - uses: actions/cache@v2 + uses: actions/cache@v3 id: cocoapodCache with: path: Pods diff --git a/.github/workflows/deploy_production_firebase.yml b/.github/workflows/deploy_production_firebase.yml index 67e22e30..c20af014 100644 --- a/.github/workflows/deploy_production_firebase.yml +++ b/.github/workflows/deploy_production_firebase.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -33,13 +33,13 @@ jobs: name: Build runs-on: macOS-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Set fetch-depth (default: 1) to get whole tree with: fetch-depth: 0 - name: Install SSH key - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} @@ -47,7 +47,7 @@ jobs: run: bundle install - name: Cache Pods - uses: actions/cache@v2 + uses: actions/cache@v3 id: cocoapodCache with: path: Pods diff --git a/.github/workflows/deploy_staging_firebase.yml b/.github/workflows/deploy_staging_firebase.yml index 3c6eb30e..34231dad 100644 --- a/.github/workflows/deploy_staging_firebase.yml +++ b/.github/workflows/deploy_staging_firebase.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -33,13 +33,13 @@ jobs: name: Build runs-on: macOS-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Set fetch-depth (default: 1) to get whole tree with: fetch-depth: 0 - name: Install SSH key - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/.github/workflows/test_install_script.yml b/.github/workflows/test_install_script.yml index b7378e84..7822478e 100644 --- a/.github/workflows/test_install_script.yml +++ b/.github/workflows/test_install_script.yml @@ -13,7 +13,7 @@ jobs: name: Test runs-on: macOS-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index 04c7c863..744aa635 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -21,12 +21,12 @@ jobs: runs-on: macOS-12 steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install SSH key - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} @@ -34,7 +34,7 @@ jobs: run: bundle install - name: Cache Pods - uses: actions/cache@v2 + uses: actions/cache@v3 id: cocoapodCache with: path: Pods From 9834b246a838d8a590478ecf3f4cb221cf8f0951 Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Wed, 1 Mar 2023 11:41:56 +0700 Subject: [PATCH 03/56] Set the correct provisioning profile after match sync --- fastlane/Fastfile.swift | 14 ----------- fastlane/Helpers/Match.swift | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index f6724110..b88ecfd0 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -145,20 +145,6 @@ class Fastfile: LaneFile { ) } - func updateProvisionSettingsLane() { - desc("Update Provision Profile") - syncAppStoreCodeSigningLane() - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - teamId: .userDefined(EnvironmentParser.string(key: "sigh_\(Constant.productionBundleId)_appstore_team-id")), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined(EnvironmentParser.string( - key: "sigh_\(Constant.productionBundleId)_appstore_profile-name" - )) - ) - } - func setUpTestProjectLane() { desc("Disable Exempt Encryption") Test.disableExemptEncryption() diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index f19aab1e..66de9b57 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -32,6 +32,51 @@ enum Match { gitUrl: Constant.matchURL, force: .userDefined(isForce) ) + updateCodeSigning(type: type, appIdentifier: appIdentifier) + } + } + + static func updateCodeSigning(type: MatchType, appIdentifier: [String]) { + // Update Code signing from automatic to manual + switch type { + case .development: + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["Release Staging"]), + codeSignIdentity: .userDefined("iPhone Developer"), + profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") + ) + case .adHoc: + if appIdentifier.first == Constant.productionBundleId { + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["Debug Production"]), + codeSignIdentity: .userDefined("iPhone Distribution"), + profileName: .userDefined("match AdHoc \(Constant.productionBundleId)") + ) + } else { + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["Release Staging"]), + codeSignIdentity: .userDefined("iPhone Distribution"), + profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") + ) + } + case .appStore: + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["Release Production"]), + codeSignIdentity: .userDefined("iPhone Distribution"), + profileName: .userDefined("match AppStore \(Constant.productionBundleId)") + ) } } } From e3c67cead035ecbb0aa812818a528ff0c3cbc4c9 Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Wed, 1 Mar 2023 11:48:40 +0700 Subject: [PATCH 04/56] Update code signing for CI too --- fastlane/Helpers/Match.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 66de9b57..cb08e052 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -32,8 +32,8 @@ enum Match { gitUrl: Constant.matchURL, force: .userDefined(isForce) ) - updateCodeSigning(type: type, appIdentifier: appIdentifier) } + updateCodeSigning(type: type, appIdentifier: appIdentifier) } static func updateCodeSigning(type: MatchType, appIdentifier: [String]) { From 85c403da3f7d3c3506e21d84c85fa6a194a058cb Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Thu, 2 Mar 2023 10:14:28 +0700 Subject: [PATCH 05/56] Fix Debug staging config --- fastlane/Helpers/Match.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index cb08e052..0c5121fb 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -44,9 +44,9 @@ enum Match { path: Constant.projectPath, useAutomaticSigning: .userDefined(false), targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Release Staging"]), + buildConfigurations: .userDefined(["Debug Staging"]), codeSignIdentity: .userDefined("iPhone Developer"), - profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") + profileName: .userDefined("match Development \(Constant.stagingBundleId)") ) case .adHoc: if appIdentifier.first == Constant.productionBundleId { From 1535c5cb0d5bbf270591150c474651edb75713e8 Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Thu, 2 Mar 2023 10:39:28 +0700 Subject: [PATCH 06/56] Change Debug Production Profile --- fastlane/Helpers/Match.swift | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 0c5121fb..c9975c0b 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -40,34 +40,34 @@ enum Match { // Update Code signing from automatic to manual switch type { case .development: - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Debug Staging"]), - codeSignIdentity: .userDefined("iPhone Developer"), - profileName: .userDefined("match Development \(Constant.stagingBundleId)") - ) - case .adHoc: if appIdentifier.first == Constant.productionBundleId { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), targets: .userDefined([Constant.projectName]), buildConfigurations: .userDefined(["Debug Production"]), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined("match AdHoc \(Constant.productionBundleId)") + codeSignIdentity: .userDefined("iPhone Developer"), + profileName: .userDefined("match \(type.method) \(Constant.productionBundleId)") ) } else { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Release Staging"]), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") + buildConfigurations: .userDefined(["Debug Staging"]), + codeSignIdentity: .userDefined("iPhone Developer"), + profileName: .userDefined("match \(type.method) \(Constant.stagingBundleId)") ) } + case .adHoc: + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["Release Staging"]), + codeSignIdentity: .userDefined("iPhone Distribution"), + profileName: .userDefined("match \(type.method) \(Constant.stagingBundleId)") + ) case .appStore: updateCodeSigningSettings( path: Constant.projectPath, @@ -75,7 +75,7 @@ enum Match { targets: .userDefined([Constant.projectName]), buildConfigurations: .userDefined(["Release Production"]), codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined("match AppStore \(Constant.productionBundleId)") + profileName: .userDefined("match \(type.method) \(Constant.productionBundleId)") ) } } @@ -90,5 +90,13 @@ extension Match { case appStore = "appstore" var value: String { return rawValue } + + var method: String { + switch self { + case .development: return "Development" + case .adHoc: return "AdHoc" + case .appStore: return "AppStore" + } + } } } From 9bc943cca5002036bd3dd42168db968fe8df75d9 Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Thu, 2 Mar 2023 10:47:58 +0700 Subject: [PATCH 07/56] add match development Production lane --- fastlane/Fastfile.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index b88ecfd0..c4abc877 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -12,13 +12,21 @@ class Fastfile: LaneFile { // MARK: - Code signing - func syncDevelopmentCodeSigningLane() { + func syncDevelopmentStagingCodeSigningLane() { desc("Sync the Development match signing for the Staging build") Match.syncCodeSigning( type: .development, appIdentifier: [Constant.stagingBundleId] ) } + + func syncDevelopmentProductionCodeSigningLane() { + desc("Sync the Development match signing for the Staging build") + Match.syncCodeSigning( + type: .development, + appIdentifier: [Constant.productionBundleId] + ) + } func syncAdHocStagingCodeSigningLane() { desc("Sync the Ad Hoc match signing for the Staging build") From f86b7dcc4d1f7a3b69f115db4b0f72d5dc877e01 Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Wed, 8 Mar 2023 10:57:53 +0700 Subject: [PATCH 08/56] Refactored to use enums more --- fastlane/Fastfile.swift | 14 +++--- fastlane/Helpers/Match.swift | 84 +++++++++++++++++------------------- 2 files changed, 46 insertions(+), 52 deletions(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index c4abc877..b5be4b11 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -16,7 +16,7 @@ class Fastfile: LaneFile { desc("Sync the Development match signing for the Staging build") Match.syncCodeSigning( type: .development, - appIdentifier: [Constant.stagingBundleId] + environment: .staging ) } @@ -24,7 +24,7 @@ class Fastfile: LaneFile { desc("Sync the Development match signing for the Staging build") Match.syncCodeSigning( type: .development, - appIdentifier: [Constant.productionBundleId] + environment: .production ) } @@ -32,7 +32,7 @@ class Fastfile: LaneFile { desc("Sync the Ad Hoc match signing for the Staging build") Match.syncCodeSigning( type: .adHoc, - appIdentifier: [Constant.stagingBundleId] + environment: .staging ) } @@ -40,7 +40,7 @@ class Fastfile: LaneFile { desc("Sync the Ad Hoc match signing for the Production build") Match.syncCodeSigning( type: .adHoc, - appIdentifier: [Constant.productionBundleId] + environment: .production ) } @@ -48,7 +48,7 @@ class Fastfile: LaneFile { desc("Sync the App Store match signing for the Production build") Match.syncCodeSigning( type: .appStore, - appIdentifier: [Constant.productionBundleId] + environment: .production ) } @@ -170,8 +170,8 @@ class Fastfile: LaneFile { teamId: .userDefined(Constant.teamId) ) - Match.syncCodeSigning(type: .development, appIdentifier: [], isForce: true) - Match.syncCodeSigning(type: .adHoc, appIdentifier: [], isForce: true) + Match.syncCodeSigning(type: .development, environment: .staging, isForce: true) + Match.syncCodeSigning(type: .adHoc, environment: .staging, isForce: true) } // MARK: - Utilities diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index c9975c0b..4a5cf4e9 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -8,13 +8,13 @@ enum Match { - static func syncCodeSigning(type: MatchType, appIdentifier: [String], isForce: Bool = false) { + static func syncCodeSigning(type: MatchType, environment: Environment, isForce: Bool = false) { if isCi() { Keychain.create() match( type: type.value, readonly: .userDefined(!isForce), - appIdentifier: appIdentifier, + appIdentifier: [environment.bundleId], username: .userDefined(Constant.userName), teamId: .userDefined(Constant.teamId), gitUrl: Constant.matchURL, @@ -26,62 +26,42 @@ enum Match { match( type: type.value, readonly: .userDefined(!isForce), - appIdentifier: appIdentifier, + appIdentifier: [environment.bundleId], username: .userDefined(Constant.userName), teamId: .userDefined(Constant.teamId), gitUrl: Constant.matchURL, force: .userDefined(isForce) ) } - updateCodeSigning(type: type, appIdentifier: appIdentifier) + updateCodeSigning(type: type, environment: environment) } - static func updateCodeSigning(type: MatchType, appIdentifier: [String]) { + static func updateCodeSigning(type: MatchType, environment: Environment) { // Update Code signing from automatic to manual - switch type { - case .development: - if appIdentifier.first == Constant.productionBundleId { - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Debug Production"]), - codeSignIdentity: .userDefined("iPhone Developer"), - profileName: .userDefined("match \(type.method) \(Constant.productionBundleId)") - ) - } else { - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Debug Staging"]), - codeSignIdentity: .userDefined("iPhone Developer"), - profileName: .userDefined("match \(type.method) \(Constant.stagingBundleId)") - ) - } - case .adHoc: - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Release Staging"]), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined("match \(type.method) \(Constant.stagingBundleId)") - ) - case .appStore: - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Release Production"]), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined("match \(type.method) \(Constant.productionBundleId)") - ) - } + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["\(type.buildConfiguration) \(environment.rawValue)"]), + codeSignIdentity: .userDefined(type.codeSignIdentity), + profileName: .userDefined("match \(type.method) \(environment.bundleId)") + ) } } extension Match { + + enum Environment: String { + case staging = "Staging" + case production = "Production" + + var bundleId: String { + switch self { + case .staging: return Constant.stagingBundleId + case .production: return Constant.productionBundleId + } + } + } enum MatchType: String { @@ -98,5 +78,19 @@ extension Match { case .appStore: return "AppStore" } } + + var buildConfiguration: String { + switch self { + case .development: return "Debug" + case .adHoc, .appStore: return "Release" + } + } + + var codeSignIdentity: String { + switch self { + case .development: return "iPhone Developer" + case .adHoc, . appStore: return "iPhone Distribution" + } + } } } From 160be0c3b3e896f463a6d2eba80706a6334f34eb Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Wed, 8 Mar 2023 16:01:08 +0700 Subject: [PATCH 09/56] [330] Use correct lane in github workflow --- .github/workflows/test_upload_build_to_test_flight.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index 744aa635..4e0b390d 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -56,7 +56,7 @@ jobs: run: bundle exec fastlane setUpTestProject - name: Update Provision Profile - run: bundle exec fastlane updateProvisionSettings + run: bundle exec fastlane syncAppStoreCodeSigning env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} From 17edf5948e440a073a33bfe6d834738da5b17ce2 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 13 Apr 2023 09:41:19 +0700 Subject: [PATCH 10/56] [#330] Update updateCodeSingingSettings with environment value --- fastlane/Helpers/Match.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 4a5cf4e9..ddddaf4a 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -41,10 +41,13 @@ enum Match { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["\(type.buildConfiguration) \(environment.rawValue)"]), + teamId: .userDefined(EnvironmentParser.string( + key: "sigh_\(Constant.productionBundleId)_\(type.rawValue)_team-id" + )), codeSignIdentity: .userDefined(type.codeSignIdentity), - profileName: .userDefined("match \(type.method) \(environment.bundleId)") + profileName: .userDefined(EnvironmentParser.string( + key: "sigh_\(environment.bundleId)_\(type.rawValue)_profile-name" + )) ) } } From f4cc8b600c1bfd1435c89cf36d959df9803e6be3 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 13 Apr 2023 10:09:59 +0700 Subject: [PATCH 11/56] [#330] Update updateCodeSingingSettings --- fastlane/Helpers/Match.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index ddddaf4a..b30cf837 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -42,7 +42,7 @@ enum Match { path: Constant.projectPath, useAutomaticSigning: .userDefined(false), teamId: .userDefined(EnvironmentParser.string( - key: "sigh_\(Constant.productionBundleId)_\(type.rawValue)_team-id" + key: "sigh_\(environment.bundleId)_\(type.rawValue)_team-id" )), codeSignIdentity: .userDefined(type.codeSignIdentity), profileName: .userDefined(EnvironmentParser.string( From c21cd1297d3a4b4f42c56249e0ffdbd550f3ab53 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 13 Apr 2023 11:32:01 +0700 Subject: [PATCH 12/56] [#330] Update updateCodeSingingSettings --- fastlane/Helpers/Match.swift | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index b30cf837..ef68e149 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -7,7 +7,7 @@ // enum Match { - + static func syncCodeSigning(type: MatchType, environment: Environment, isForce: Bool = false) { if isCi() { Keychain.create() @@ -41,13 +41,11 @@ enum Match { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), - teamId: .userDefined(EnvironmentParser.string( - key: "sigh_\(environment.bundleId)_\(type.rawValue)_team-id" - )), + teamId: .userDefined(Constant.teamId), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["\(type.buildConfiguration) \(environment.rawValue)"]), codeSignIdentity: .userDefined(type.codeSignIdentity), - profileName: .userDefined(EnvironmentParser.string( - key: "sigh_\(environment.bundleId)_\(type.rawValue)_profile-name" - )) + profileName: .userDefined("match \(type.method) \(environment.bundleId)") ) } } @@ -55,6 +53,7 @@ enum Match { extension Match { enum Environment: String { + case staging = "Staging" case production = "Production" @@ -65,13 +64,13 @@ extension Match { } } } - + enum MatchType: String { - + case development case adHoc = "adhoc" case appStore = "appstore" - + var value: String { return rawValue } var method: String { @@ -88,7 +87,6 @@ extension Match { case .adHoc, .appStore: return "Release" } } - var codeSignIdentity: String { switch self { case .development: return "iPhone Developer" From 9c321705148be40c1316e7104cb298ccdf890eda Mon Sep 17 00:00:00 2001 From: David Date: Thu, 13 Apr 2023 11:57:39 +0700 Subject: [PATCH 13/56] [#330] Update SET UP TEST TESTFLIGHT SH --- set_up_test_testflight.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index 350baa71..73711b39 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -1,5 +1,6 @@ echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null +readonly CONSTANT_TEAM_ID="<#teamId#>" readonly CONSTANT_API_KEY_ID="<#API_KEY_ID#>" readonly CONSTANT_ISSUER_ID="<#ISSUER_ID#>" readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" @@ -7,6 +8,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 91aa28d70199d73e6750613e760bddd79876e661 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 19 Apr 2023 10:33:53 +0700 Subject: [PATCH 14/56] [#330] Update desc of syncDevelopmentProductionCodeSigningLane and buildProductionAndUploadToFirebaseLane --- fastlane/Fastfile.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index b5be4b11..b1dc07bd 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -21,7 +21,7 @@ class Fastfile: LaneFile { } func syncDevelopmentProductionCodeSigningLane() { - desc("Sync the Development match signing for the Staging build") + desc("Sync the Development match signing for the Production build") Match.syncCodeSigning( type: .development, environment: .production @@ -88,7 +88,7 @@ class Fastfile: LaneFile { } func buildProductionAndUploadToFirebaseLane() { - desc("Build Staging app and upload to Firebase") + desc("Build Production app and upload to Firebase") setAppVersion() bumpBuild() From 8f222130d26de31d470037e755dfbdb56d41285a Mon Sep 17 00:00:00 2001 From: David Date: Thu, 20 Apr 2023 13:47:38 +0700 Subject: [PATCH 15/56] [#330] Add TEAM_ID in GitHub Secret. Then import and use it as a env variable Update code format --- .github/workflows/test_upload_build_to_test_flight.yml | 2 ++ fastlane/Helpers/Match.swift | 6 +++--- set_up_test_testflight.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index 4e0b390d..91cdf243 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -7,6 +7,7 @@ name: Test Upload Build to TestFlight ### API_KEY_ID ### ISSUER_ID ### APPSTORE_CONNECT_API_KEY +### TEAM_ID on: pull_request @@ -51,6 +52,7 @@ jobs: MATCH_REPO: ${{ secrets.MATCH_REPO }} API_KEY_ID: ${{ secrets.API_KEY_ID }} ISSUER_ID: ${{ secrets.ISSUER_ID }} + TEAM_ID: ${{ secrets.TEAM_ID }} - name: Set Up Test Project for App Store run: bundle exec fastlane setUpTestProject diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index ef68e149..e4131d5b 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -66,13 +66,13 @@ extension Match { } enum MatchType: String { - + case development case adHoc = "adhoc" case appStore = "appstore" - + var value: String { return rawValue } - + var method: String { switch self { case .development: return "Development" diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index 73711b39..7455f34a 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -8,7 +8,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 4ef406174c5f39c644b68300fb1bf20e366716e4 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 09:17:17 +0700 Subject: [PATCH 16/56] [#330] Update code format --- fastlane/Helpers/Match.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index e4131d5b..c807249a 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -7,7 +7,7 @@ // enum Match { - + static func syncCodeSigning(type: MatchType, environment: Environment, isForce: Bool = false) { if isCi() { Keychain.create() From 30152ccf1330397d42c56fb45274ccb8329bd4d8 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 13:14:25 +0700 Subject: [PATCH 17/56] [#330] Remove Match.Environment and MatchType Merge Match.Environment to Constant.Environment Merge Match.MatchType to Constant.BuildType --- fastlane/Constants/Constant.swift | 20 ++++++++++-- fastlane/Helpers/Match.swift | 54 +++++-------------------------- 2 files changed, 26 insertions(+), 48 deletions(-) diff --git a/fastlane/Constants/Constant.swift b/fastlane/Constants/Constant.swift index adc32ed8..dd45ef98 100644 --- a/fastlane/Constants/Constant.swift +++ b/fastlane/Constants/Constant.swift @@ -79,7 +79,7 @@ extension Constant { enum Environment: String { case staging = "Staging" - case production = "" + case production = "Production" var productName: String { "\(Constant.projectName) \(rawValue)".trimmed } @@ -116,13 +116,29 @@ extension Constant { enum BuildType: String { + case development case adHoc = "ad-hoc" case appStore = "app-store" var value: String { return rawValue } - + + var configuration: String { + switch self { + case .development: return "Debug" + case .adHoc, .appStore: return "Release" + } + } + + var codeSignIdentity: String { + switch self { + case .development: return "iPhone Developer" + case .adHoc, . appStore: return "iPhone Distribution" + } + } + var method: String { switch self { + case .development: return "Development" case .adHoc: return "AdHoc" case .appStore: return "AppStore" } diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index c807249a..8e7f0dd8 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -8,7 +8,7 @@ enum Match { - static func syncCodeSigning(type: MatchType, environment: Environment, isForce: Bool = false) { + static func syncCodeSigning(type: Constant.BuildType, environment: Constant.Environment, isForce: Bool = false) { if isCi() { Keychain.create() match( @@ -36,62 +36,24 @@ enum Match { updateCodeSigning(type: type, environment: environment) } - static func updateCodeSigning(type: MatchType, environment: Environment) { + static func updateCodeSigning(type: Constant.BuildType, environment: Constant.Environment) { // Update Code signing from automatic to manual updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), teamId: .userDefined(Constant.teamId), targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["\(type.buildConfiguration) \(environment.rawValue)"]), + buildConfigurations: .userDefined([Self.createBuildConfiguration(type: type, environment: environment)]), codeSignIdentity: .userDefined(type.codeSignIdentity), - profileName: .userDefined("match \(type.method) \(environment.bundleId)") + profileName: .userDefined(Self.createProfileName(type: type, environment: environment)) ) } -} - -extension Match { - enum Environment: String { - - case staging = "Staging" - case production = "Production" - - var bundleId: String { - switch self { - case .staging: return Constant.stagingBundleId - case .production: return Constant.productionBundleId - } - } + static func createBuildConfiguration(type: Constant.BuildType, environment: Constant.Environment) -> String { + "\(type.configuration) \(environment.rawValue)" } - enum MatchType: String { - - case development - case adHoc = "adhoc" - case appStore = "appstore" - - var value: String { return rawValue } - - var method: String { - switch self { - case .development: return "Development" - case .adHoc: return "AdHoc" - case .appStore: return "AppStore" - } - } - - var buildConfiguration: String { - switch self { - case .development: return "Debug" - case .adHoc, .appStore: return "Release" - } - } - var codeSignIdentity: String { - switch self { - case .development: return "iPhone Developer" - case .adHoc, . appStore: return "iPhone Distribution" - } - } + static func createProfileName(type: Constant.BuildType, environment: Constant.Environment) -> String { + "match \(type.method) \(environment.bundleId)" } } From 6fcb7fbbd59efe486c51032996fa9f79ba9d5504 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 13:16:20 +0700 Subject: [PATCH 18/56] [#330] Revert to use hard code team id for test test flight --- set_up_test_testflight.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index 7455f34a..5428a5c2 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -1,5 +1,3 @@ -echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null - readonly CONSTANT_TEAM_ID="<#teamId#>" readonly CONSTANT_API_KEY_ID="<#API_KEY_ID#>" readonly CONSTANT_ISSUER_ID="<#ISSUER_ID#>" @@ -8,7 +6,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 253e367c20d91f14c0e42ff4672002bbcc8873ba Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 13:18:51 +0700 Subject: [PATCH 19/56] [#330] Improve code --- fastlane/Helpers/Build.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Helpers/Build.swift b/fastlane/Helpers/Build.swift index b1e3682f..587b62d9 100644 --- a/fastlane/Helpers/Build.swift +++ b/fastlane/Helpers/Build.swift @@ -52,7 +52,7 @@ enum Build { exportMethod: .userDefined(type.value), exportOptions: .userDefined([ "provisioningProfiles": [ - environment.bundleId: "match \(type.method) \(environment.bundleId)" + environment.bundleId: Match.createProfileName(type: type, environment: environment) ] ]), buildPath: .userDefined(Constant.buildPath), From 6666c185a80688dec507e602b7d17de42ea455c2 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 13:28:41 +0700 Subject: [PATCH 20/56] [#330] Update match type --- fastlane/Constants/Constant.swift | 8 ++++++++ fastlane/Helpers/Match.swift | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fastlane/Constants/Constant.swift b/fastlane/Constants/Constant.swift index dd45ef98..5de3e928 100644 --- a/fastlane/Constants/Constant.swift +++ b/fastlane/Constants/Constant.swift @@ -122,6 +122,14 @@ extension Constant { var value: String { return rawValue } + var match: String { + switch self { + case .development: return "development" + case .adHoc: return "adhoc" + case .appStore: return "appstore" + } + } + var configuration: String { switch self { case .development: return "Debug" diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 8e7f0dd8..7065e442 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -12,7 +12,7 @@ enum Match { if isCi() { Keychain.create() match( - type: type.value, + type: type.match, readonly: .userDefined(!isForce), appIdentifier: [environment.bundleId], username: .userDefined(Constant.userName), @@ -24,7 +24,7 @@ enum Match { ) } else { match( - type: type.value, + type: type.match, readonly: .userDefined(!isForce), appIdentifier: [environment.bundleId], username: .userDefined(Constant.userName), From fd3b3ba45e95290b8be3e7b53da90f1cb87d51e5 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 13:36:26 +0700 Subject: [PATCH 21/56] [#330] Remove setting team id --- fastlane/Constants/Constant.swift | 7 ++++++- fastlane/Helpers/Match.swift | 1 - set_up_test_testflight.sh | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fastlane/Constants/Constant.swift b/fastlane/Constants/Constant.swift index 5de3e928..e8dfa15c 100644 --- a/fastlane/Constants/Constant.swift +++ b/fastlane/Constants/Constant.swift @@ -83,7 +83,12 @@ extension Constant { var productName: String { "\(Constant.projectName) \(rawValue)".trimmed } - var scheme: String { "\(Constant.projectName) \(rawValue)".trimmed } + var scheme: String { + switch self { + case .staging: return "\(Constant.projectName) \(rawValue)".trimmed + case .production: return Constant.projectName + } + } var bundleId: String { switch self { diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 7065e442..86bbac82 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -41,7 +41,6 @@ enum Match { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), - teamId: .userDefined(Constant.teamId), targets: .userDefined([Constant.projectName]), buildConfigurations: .userDefined([Self.createBuildConfiguration(type: type, environment: environment)]), codeSignIdentity: .userDefined(type.codeSignIdentity), diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index 5428a5c2..ad855795 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -1,4 +1,3 @@ -readonly CONSTANT_TEAM_ID="<#teamId#>" readonly CONSTANT_API_KEY_ID="<#API_KEY_ID#>" readonly CONSTANT_ISSUER_ID="<#ISSUER_ID#>" readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" @@ -6,7 +5,6 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 57a3c1ad786bcad2d66f21776f848a6d9b278ca5 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 14:43:18 +0700 Subject: [PATCH 22/56] [#330] Update setting teamId in Match updateCodeSingingSettings Update hard-code teamId in set_up_test_testflight.sh --- fastlane/Helpers/Match.swift | 1 + set_up_test_testflight.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 86bbac82..7065e442 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -41,6 +41,7 @@ enum Match { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), + teamId: .userDefined(Constant.teamId), targets: .userDefined([Constant.projectName]), buildConfigurations: .userDefined([Self.createBuildConfiguration(type: type, environment: environment)]), codeSignIdentity: .userDefined(type.codeSignIdentity), diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index ad855795..5428a5c2 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -1,3 +1,4 @@ +readonly CONSTANT_TEAM_ID="<#teamId#>" readonly CONSTANT_API_KEY_ID="<#API_KEY_ID#>" readonly CONSTANT_ISSUER_ID="<#ISSUER_ID#>" readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" @@ -5,6 +6,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 5c37056004e869746b52b5d187289756c6afa7bc Mon Sep 17 00:00:00 2001 From: Edgars Simanovskis Date: Tue, 14 Mar 2023 11:11:39 +0700 Subject: [PATCH 23/56] [310] Support multiple apple accounts --- fastlane/Constants/Constant.swift | 20 +++++++++++++++++-- fastlane/Fastfile.swift | 6 +++--- fastlane/Helpers/AppStoreAuthentication.swift | 2 +- fastlane/Helpers/Match.swift | 10 +++++----- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/fastlane/Constants/Constant.swift b/fastlane/Constants/Constant.swift index e8dfa15c..cd94ebfa 100644 --- a/fastlane/Constants/Constant.swift +++ b/fastlane/Constants/Constant.swift @@ -22,8 +22,10 @@ enum Constant { // MARK: - Match - static let userName = "<#userName#>" - static let teamId = "<#teamId#>" + static let appleStagingUserName = "<#userName#>" + static let appleStagingTeamId = "<#teamId#>" + static let appleProductionUserName = "<#userName#>" + static let appleProductionTeamId = "<#teamId#>" static let keychainName = "github_action_keychain" static let matchURL = "git@github.com:{organization}/{repo}.git" @@ -117,6 +119,20 @@ extension Constant { let outputDirectoryURL = URL(fileURLWithPath: Constant.outputPath) return outputDirectoryURL.appendingPathComponent(productName + ".app" + Constant.dSYMSuffix).relativePath } + + var appleUsername: String { + switch self { + case .staging: return Constant.appleStagingUserName + case .production: return Constant.appleProductionUserName + } + } + + var appleTeamId: String { + switch self { + case .staging: return Constant.appleStagingTeamId + case .production: return Constant.appleProductionTeamId + } + } } enum BuildType: String { diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index b1dc07bd..46f1ae3a 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -107,7 +107,7 @@ class Fastfile: LaneFile { desc("Build Production app and upload to App Store") setAppVersion() - AppStoreAuthentication.connectAPIKey() + AppStoreAuthentication.connectProductionAPIKey() if Secret.bumpAppStoreBuildNumber { bumpAppstoreBuild() } else { @@ -131,7 +131,7 @@ class Fastfile: LaneFile { buildAppStoreLane() - AppStoreAuthentication.connectAPIKey() + AppStoreAuthentication.connectProductionAPIKey() Distribution.uploadToTestFlight() Symbol.uploadToCrashlytics(environment: .production) @@ -167,7 +167,7 @@ class Fastfile: LaneFile { registerDevice( name: deviceName, udid: deviceUDID, - teamId: .userDefined(Constant.teamId) + teamId: .userDefined(Constant.appleStagingTeamId) ) Match.syncCodeSigning(type: .development, environment: .staging, isForce: true) diff --git a/fastlane/Helpers/AppStoreAuthentication.swift b/fastlane/Helpers/AppStoreAuthentication.swift index 8eaded06..7435d50b 100644 --- a/fastlane/Helpers/AppStoreAuthentication.swift +++ b/fastlane/Helpers/AppStoreAuthentication.swift @@ -10,7 +10,7 @@ import Foundation enum AppStoreAuthentication { - static func connectAPIKey() { + static func connectProductionAPIKey() { appStoreConnectApiKey( keyId: Secret.appStoreKeyIdKey, issuerId: Secret.appStoreIssuerIdKey, diff --git a/fastlane/Helpers/Match.swift b/fastlane/Helpers/Match.swift index 7065e442..2bcdd392 100644 --- a/fastlane/Helpers/Match.swift +++ b/fastlane/Helpers/Match.swift @@ -15,8 +15,8 @@ enum Match { type: type.match, readonly: .userDefined(!isForce), appIdentifier: [environment.bundleId], - username: .userDefined(Constant.userName), - teamId: .userDefined(Constant.teamId), + username: .userDefined(environment.appleUsername), + teamId: .userDefined(environment.appleTeamId), gitUrl: Constant.matchURL, keychainName: Constant.keychainName, keychainPassword: .userDefined(Secret.keychainPassword), @@ -27,8 +27,8 @@ enum Match { type: type.match, readonly: .userDefined(!isForce), appIdentifier: [environment.bundleId], - username: .userDefined(Constant.userName), - teamId: .userDefined(Constant.teamId), + username: .userDefined(environment.appleUsername), + teamId: .userDefined(environment.appleTeamId), gitUrl: Constant.matchURL, force: .userDefined(isForce) ) @@ -41,7 +41,7 @@ enum Match { updateCodeSigningSettings( path: Constant.projectPath, useAutomaticSigning: .userDefined(false), - teamId: .userDefined(Constant.teamId), + teamId: .userDefined(environment.appleTeamId), targets: .userDefined([Constant.projectName]), buildConfigurations: .userDefined([Self.createBuildConfiguration(type: type, environment: environment)]), codeSignIdentity: .userDefined(type.codeSignIdentity), From f7f7530e58255ec18277423d1eb66d623325edf4 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 19 Apr 2023 11:50:12 +0700 Subject: [PATCH 24/56] [310] Fix Production Scheme --- fastlane/Constants/Constant.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastlane/Constants/Constant.swift b/fastlane/Constants/Constant.swift index cd94ebfa..c77b3cee 100644 --- a/fastlane/Constants/Constant.swift +++ b/fastlane/Constants/Constant.swift @@ -84,14 +84,14 @@ extension Constant { case production = "Production" var productName: String { "\(Constant.projectName) \(rawValue)".trimmed } - + var scheme: String { switch self { case .staging: return "\(Constant.projectName) \(rawValue)".trimmed - case .production: return Constant.projectName + case .production: return Constant.projectName.trimmed } } - + var bundleId: String { switch self { case .staging: return Constant.stagingBundleId From 54bd28f9aaa11a1a295c1b78c066d84d680ebe60 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 14:44:53 +0700 Subject: [PATCH 25/56] [310] Rename connectProductionAPIKey -> connectAPIKey --- fastlane/Fastfile.swift | 4 ++-- fastlane/Helpers/AppStoreAuthentication.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 46f1ae3a..ccba6fe1 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -107,7 +107,7 @@ class Fastfile: LaneFile { desc("Build Production app and upload to App Store") setAppVersion() - AppStoreAuthentication.connectProductionAPIKey() + AppStoreAuthentication.connectAPIKey() if Secret.bumpAppStoreBuildNumber { bumpAppstoreBuild() } else { @@ -131,7 +131,7 @@ class Fastfile: LaneFile { buildAppStoreLane() - AppStoreAuthentication.connectProductionAPIKey() + AppStoreAuthentication.connectAPIKey() Distribution.uploadToTestFlight() Symbol.uploadToCrashlytics(environment: .production) diff --git a/fastlane/Helpers/AppStoreAuthentication.swift b/fastlane/Helpers/AppStoreAuthentication.swift index 7435d50b..8eaded06 100644 --- a/fastlane/Helpers/AppStoreAuthentication.swift +++ b/fastlane/Helpers/AppStoreAuthentication.swift @@ -10,7 +10,7 @@ import Foundation enum AppStoreAuthentication { - static func connectProductionAPIKey() { + static func connectAPIKey() { appStoreConnectApiKey( keyId: Secret.appStoreKeyIdKey, issuerId: Secret.appStoreIssuerIdKey, From 466030093d6030049237e78e9999906abbdea67c Mon Sep 17 00:00:00 2001 From: David Date: Mon, 10 Apr 2023 17:05:36 +0700 Subject: [PATCH 26/56] [#471] Update GoogleService-Info.plist --- .../Production/GoogleService-Info.plist | 31 +++++++++++++++++-- .../Staging/GoogleService-Info.plist | 31 +++++++++++++++++-- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist index d6f0fc7a..077dcf15 100644 --- a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist +++ b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist @@ -2,6 +2,33 @@ + CLIENT_ID + 394751167018-neam9mprlt90s44eiuvaicaa8r1t4frl.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.394751167018-neam9mprlt90s44eiuvaicaa8r1t4frl + API_KEY + AIzaSyCpoXIw7nz6ITzby0FLwiQsj4IjzgUmMiE + GCM_SENDER_ID + 394751167018 + PLIST_VERSION + 1 + BUNDLE_ID + co.nimblehq.ios.templates + PROJECT_ID + nimble-ios-template + STORAGE_BUCKET + nimble-ios-template.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:394751167018:ios:8ab5165fcff843c5b21153 - - + \ No newline at end of file diff --git a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist index a71fe808..b8e3db3a 100644 --- a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist +++ b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist @@ -2,6 +2,33 @@ + CLIENT_ID + 394751167018-23t4g5tv72ttt7fq3akqps2nb6lqaitt.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.394751167018-23t4g5tv72ttt7fq3akqps2nb6lqaitt + API_KEY + AIzaSyCpoXIw7nz6ITzby0FLwiQsj4IjzgUmMiE + GCM_SENDER_ID + 394751167018 + PLIST_VERSION + 1 + BUNDLE_ID + co.nimblehq.ios.templates.staging + PROJECT_ID + nimble-ios-template + STORAGE_BUCKET + nimble-ios-template.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:394751167018:ios:7670aacd2a018cd5b21153 - - + \ No newline at end of file From c6f9aabd610b9bc9221690d1760c63a2d2301d6d Mon Sep 17 00:00:00 2001 From: David Date: Mon, 10 Apr 2023 17:28:53 +0700 Subject: [PATCH 27/56] [#471] Update Target+Initializing to include GoogleService-Info.plist files in project/workspaces --- Tuist/ProjectDescriptionHelpers/Target+Initializing.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift b/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift index 5e2158db..6dfb9d90 100644 --- a/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift +++ b/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift @@ -17,6 +17,7 @@ extension Target { infoPlist: "\(name)/\(plistsPath)/Info.plist", sources: ["\(name)/Sources/**"], resources: [ + "\(name)/\(plistsPath)/**", "\(name)/Resources/**", "\(name)/Sources/**/.gitkeep" // To include empty folders ], From 9d1eadfc201ce156b9661fed9785e60a843c8ecb Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 10:10:56 +0700 Subject: [PATCH 28/56] [#471] Create Test Upload Build to Firebase workflow Create set_up_test_firebase.sh file Update test upload build to firebase workflow to us latest macOS --- .../test_upload_build_to_test_firebase.yml | 78 +++++++++++++++++++ .../test_upload_build_to_test_flight.yml | 2 +- set_up_test_firebase.sh | 10 +++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test_upload_build_to_test_firebase.yml create mode 100644 set_up_test_firebase.sh diff --git a/.github/workflows/test_upload_build_to_test_firebase.yml b/.github/workflows/test_upload_build_to_test_firebase.yml new file mode 100644 index 00000000..c3c4a979 --- /dev/null +++ b/.github/workflows/test_upload_build_to_test_firebase.yml @@ -0,0 +1,78 @@ +name: Test Upload Build to Firebase + +# SECRETS needed: +### SSH_PRIVATE_KEY for Match Repo +### MATCH_PASS +### FIREBASE_TOKEN +### STAGING_FIREBASE_APP_ID + +on: + pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: macOS-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install SSH key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Install Firebase-Tools + run: | + yarn global add firebase-tools + echo "$(yarn global bin)" >> $GITHUB_PATH + + - name: Bundle install + run: bundle install + + - name: Cache Pods + uses: actions/cache@v2 + id: cocoapodCache + with: + path: Pods + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + + - name: Start Install Script for Template App + run: sh make.sh --bundle-id co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp + + - name: Start Setup Script for Template App TestFlight Upload + run: sh set_up_test_firebase.sh + env: + MATCH_REPO: ${{ secrets.MATCH_REPO }} + STAGING_FIREBASE_APP_ID: ${{ secrets.STAGING_FIREBASE_APP_ID }} + + - name: Set Up Test Project for Firebase + run: bundle exec fastlane setUpTestProject + + - name: Match Ad-hoc + run: bundle exec fastlane syncAdHocStagingCodeSigning + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} + + - name: Build App and Distribute to Firebase + run: bundle exec fastlane buildStagingAndUploadToFirebase + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ format('v{0}({1})-{2}', env.VERSION_NUMBER, env.BUILD_NUMBER, env.TAG_TYPE) }} + path: | + ${{ env.IPA_OUTPUT_PATH }} + ${{ env.DSYM_OUTPUT_PATH }} + env: + TAG_TYPE: Staging_Firebase diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index 91cdf243..fa8322b0 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -19,7 +19,7 @@ concurrency: jobs: build: name: Build - runs-on: macOS-12 + runs-on: macOS-latest steps: - name: Checkout Repo uses: actions/checkout@v3 diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh new file mode 100644 index 00000000..73b92cbf --- /dev/null +++ b/set_up_test_firebase.sh @@ -0,0 +1,10 @@ +echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null + +readonly CONSTANT_STAGING_FIREBASE_APP_ID="<#stagingFirebaseAppId#>" +readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" + +readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_STAGING_FIREBASE_APP_ID/$STAGING_FIREBASE_APP_ID/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From ec52e7448c98c3c73e1863043b186340fc78cca5 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 10:26:13 +0700 Subject: [PATCH 29/56] [#471] Update Tuist config file --- Tuist/ProjectDescriptionHelpers/Target+Initializing.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift b/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift index 6dfb9d90..5e2158db 100644 --- a/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift +++ b/Tuist/ProjectDescriptionHelpers/Target+Initializing.swift @@ -17,7 +17,6 @@ extension Target { infoPlist: "\(name)/\(plistsPath)/Info.plist", sources: ["\(name)/Sources/**"], resources: [ - "\(name)/\(plistsPath)/**", "\(name)/Resources/**", "\(name)/Sources/**/.gitkeep" // To include empty folders ], From 8e3c9749f92f839bb70aeafc31695ebe98e5b264 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 10:45:21 +0700 Subject: [PATCH 30/56] [#471] Rename Test Upload Build To Firebase workflow Add test trigger on push --- ...test_firebase.yml => test_upload_build_to_firebase.yml} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename .github/workflows/{test_upload_build_to_test_firebase.yml => test_upload_build_to_firebase.yml} (96%) diff --git a/.github/workflows/test_upload_build_to_test_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml similarity index 96% rename from .github/workflows/test_upload_build_to_test_firebase.yml rename to .github/workflows/test_upload_build_to_firebase.yml index c3c4a979..41a126f4 100644 --- a/.github/workflows/test_upload_build_to_test_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -6,9 +6,12 @@ name: Test Upload Build to Firebase ### FIREBASE_TOKEN ### STAGING_FIREBASE_APP_ID +#on: +# pull_request on: - pull_request - + push: + branches: [ feature/**, bug/**, chore/** ] + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true From 03042e9457bcbd41ee794b17f339bc324bf120ce Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 11:10:53 +0700 Subject: [PATCH 31/56] [#471] Rename Secret key from FIREBASE_CLI_TOKEN to FIREBASE_TOKEN --- fastlane/Constants/Secret.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Constants/Secret.swift b/fastlane/Constants/Secret.swift index 370d094d..9385dd07 100644 --- a/fastlane/Constants/Secret.swift +++ b/fastlane/Constants/Secret.swift @@ -11,7 +11,7 @@ enum Secret { static let keychainPassword = EnvironmentParser.string(key: "KEYCHAIN_PASSWORD") - static let firebaseCLIToken = EnvironmentParser.string(key: "FIREBASE_CLI_TOKEN") + static let firebaseCLIToken = EnvironmentParser.string(key: "FIREBASE_TOKEN") static let appstoreConnectAPIKey = EnvironmentParser.string(key: "APPSTORE_CONNECT_API_KEY") From 9ed6138a142866628762a3374107def7f244e80f Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 11:48:16 +0700 Subject: [PATCH 32/56] [#471] Update test code in Fastfile --- fastlane/Fastfile.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index b1dc07bd..5ebb3f10 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -34,8 +34,17 @@ class Fastfile: LaneFile { type: .adHoc, environment: .staging ) + // TODO: Remove after workflow run successfully + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + targets: .userDefined([Constant.projectName]), + buildConfigurations: .userDefined(["Release Staging"]), + codeSignIdentity: .userDefined("iPhone Distribution"), + profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") + ) } - + func syncAdHocProductionCodeSigningLane() { desc("Sync the Ad Hoc match signing for the Production build") Match.syncCodeSigning( From fa545914c6c73536784ebb0b4cf708b294994362 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 11:59:50 +0700 Subject: [PATCH 33/56] [#471] Update UpdateCodeSigningSettings before Match --- fastlane/Fastfile.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 5ebb3f10..a2a1ee88 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -43,6 +43,10 @@ class Fastfile: LaneFile { codeSignIdentity: .userDefined("iPhone Distribution"), profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") ) + Match.syncCodeSigning( + type: .adHoc, + appIdentifier: [Constant.stagingBundleId] + ) } func syncAdHocProductionCodeSigningLane() { From f9007c3b0b72e742dd6c4c9475dc83bae8544760 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 12:16:50 +0700 Subject: [PATCH 34/56] [#471] Update Test deploy build to Firebase Revert Fastfile code --- .github/workflows/test_upload_build_to_firebase.yml | 5 +++++ fastlane/Fastfile.swift | 13 ------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index 41a126f4..155f8283 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -60,6 +60,11 @@ jobs: - name: Set Up Test Project for Firebase run: bundle exec fastlane setUpTestProject + - name: Match Ad-hoc + run: bundle exec fastlane syncAdHocStagingCodeSigning + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} + # Call second match to resolve There are no local code signing identities found - name: Match Ad-hoc run: bundle exec fastlane syncAdHocStagingCodeSigning env: diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index a2a1ee88..a515a3d4 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -30,19 +30,6 @@ class Fastfile: LaneFile { func syncAdHocStagingCodeSigningLane() { desc("Sync the Ad Hoc match signing for the Staging build") - Match.syncCodeSigning( - type: .adHoc, - environment: .staging - ) - // TODO: Remove after workflow run successfully - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - targets: .userDefined([Constant.projectName]), - buildConfigurations: .userDefined(["Release Staging"]), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined("match AdHoc \(Constant.stagingBundleId)") - ) Match.syncCodeSigning( type: .adHoc, appIdentifier: [Constant.stagingBundleId] From 3fb461a6498711a842d5be173b9edc5913f6f88a Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 12:59:52 +0700 Subject: [PATCH 35/56] [#471] Update Fastfile --- .github/workflows/test_upload_build_to_firebase.yml | 5 ----- fastlane/Fastfile.swift | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index 155f8283..41a126f4 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -60,11 +60,6 @@ jobs: - name: Set Up Test Project for Firebase run: bundle exec fastlane setUpTestProject - - name: Match Ad-hoc - run: bundle exec fastlane syncAdHocStagingCodeSigning - env: - MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - # Call second match to resolve There are no local code signing identities found - name: Match Ad-hoc run: bundle exec fastlane syncAdHocStagingCodeSigning env: diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index a515a3d4..8d31bb1c 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -34,6 +34,15 @@ class Fastfile: LaneFile { type: .adHoc, appIdentifier: [Constant.stagingBundleId] ) + updateCodeSigningSettings( + path: Constant.projectPath, + useAutomaticSigning: .userDefined(false), + teamId: .userDefined(EnvironmentParser.string(key: "sigh_\(Constant.stagingBundleId)_adhoc_team-id")), + codeSignIdentity: .userDefined("iPhone Distribution"), + profileName: .userDefined(EnvironmentParser.string( + key: "sigh_\(Constant.stagingBundleId)_adhoc_profile-name" + )) + ) } func syncAdHocProductionCodeSigningLane() { From f14e2cb7fe8a1b85c451dd2f3e3aa99f3caa891b Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 13:43:18 +0700 Subject: [PATCH 36/56] [#471] Update set_up_test_firebase.sh to replace firebase tester groups with nimble --- set_up_test_firebase.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index 73b92cbf..ee396e4c 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -1,10 +1,12 @@ echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null readonly CONSTANT_STAGING_FIREBASE_APP_ID="<#stagingFirebaseAppId#>" +readonly CONSTANT_FIREBASE_TESTER_GROUPS=["<#group1#>", "<#group2#>"] readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_STAGING_FIREBASE_APP_ID/$STAGING_FIREBASE_APP_ID/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_FIREBASE_TESTER_GROUPS/nimble/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 83224e03dcc4929ff9a697523f0c834611fbce79 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 14:11:45 +0700 Subject: [PATCH 37/56] [#471] Update set_up_test_firebase.sh to replace firebase tester groups with nimble --- set_up_test_firebase.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index ee396e4c..276765a5 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -1,7 +1,7 @@ echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null readonly CONSTANT_STAGING_FIREBASE_APP_ID="<#stagingFirebaseAppId#>" -readonly CONSTANT_FIREBASE_TESTER_GROUPS=["<#group1#>", "<#group2#>"] +readonly CONSTANT_FIREBASE_TESTER_GROUPS="<#group1#>, <#group2#>" readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) From b5461b3808428d7c035a2e7c3e436e2659ce25f7 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 15:27:27 +0700 Subject: [PATCH 38/56] [#471] Create updateCodeSignStagingFirebaseLane Rename updateProvisionSettingsLane to updateCodeSignTestFlightLane for clearer Update workflows --- .github/workflows/test_upload_build_to_test_flight.yml | 2 +- fastlane/Fastfile.swift | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index fa8322b0..741fe41b 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -57,7 +57,7 @@ jobs: - name: Set Up Test Project for App Store run: bundle exec fastlane setUpTestProject - - name: Update Provision Profile + - name: Match Appstore run: bundle exec fastlane syncAppStoreCodeSigning env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 8d31bb1c..a515a3d4 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -34,15 +34,6 @@ class Fastfile: LaneFile { type: .adHoc, appIdentifier: [Constant.stagingBundleId] ) - updateCodeSigningSettings( - path: Constant.projectPath, - useAutomaticSigning: .userDefined(false), - teamId: .userDefined(EnvironmentParser.string(key: "sigh_\(Constant.stagingBundleId)_adhoc_team-id")), - codeSignIdentity: .userDefined("iPhone Distribution"), - profileName: .userDefined(EnvironmentParser.string( - key: "sigh_\(Constant.stagingBundleId)_adhoc_profile-name" - )) - ) } func syncAdHocProductionCodeSigningLane() { From 02fbba78d2f85a79115d606388563e40255983c6 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Apr 2023 16:33:47 +0700 Subject: [PATCH 39/56] [#471] Remove test code --- .github/workflows/test_upload_build_to_firebase.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index 41a126f4..306daa02 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -6,11 +6,8 @@ name: Test Upload Build to Firebase ### FIREBASE_TOKEN ### STAGING_FIREBASE_APP_ID -#on: -# pull_request on: - push: - branches: [ feature/**, bug/**, chore/** ] + pull_request concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 7c0bd727bc9785fe370eedac1593b85c260ac9fd Mon Sep 17 00:00:00 2001 From: David Date: Wed, 12 Apr 2023 10:55:13 +0700 Subject: [PATCH 40/56] [#471] Update name --- .github/workflows/test_upload_build_to_firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index 306daa02..e957f446 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -48,7 +48,7 @@ jobs: - name: Start Install Script for Template App run: sh make.sh --bundle-id co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp - - name: Start Setup Script for Template App TestFlight Upload + - name: Start Setup Script for Template App Firebase Upload run: sh set_up_test_firebase.sh env: MATCH_REPO: ${{ secrets.MATCH_REPO }} From ca58e80dcc6042c0401f91c1592b4e078486606a Mon Sep 17 00:00:00 2001 From: David Date: Wed, 12 Apr 2023 13:34:24 +0700 Subject: [PATCH 41/56] [#471] Remove GoogleService-Info.plist --- .../Production/GoogleService-Info.plist | 31 ++----------------- .../Staging/GoogleService-Info.plist | 31 ++----------------- 2 files changed, 4 insertions(+), 58 deletions(-) diff --git a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist index 077dcf15..d6f0fc7a 100644 --- a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist +++ b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Production/GoogleService-Info.plist @@ -2,33 +2,6 @@ - CLIENT_ID - 394751167018-neam9mprlt90s44eiuvaicaa8r1t4frl.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.394751167018-neam9mprlt90s44eiuvaicaa8r1t4frl - API_KEY - AIzaSyCpoXIw7nz6ITzby0FLwiQsj4IjzgUmMiE - GCM_SENDER_ID - 394751167018 - PLIST_VERSION - 1 - BUNDLE_ID - co.nimblehq.ios.templates - PROJECT_ID - nimble-ios-template - STORAGE_BUCKET - nimble-ios-template.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:394751167018:ios:8ab5165fcff843c5b21153 - \ No newline at end of file + + diff --git a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist index b8e3db3a..a71fe808 100644 --- a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist +++ b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Staging/GoogleService-Info.plist @@ -2,33 +2,6 @@ - CLIENT_ID - 394751167018-23t4g5tv72ttt7fq3akqps2nb6lqaitt.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.394751167018-23t4g5tv72ttt7fq3akqps2nb6lqaitt - API_KEY - AIzaSyCpoXIw7nz6ITzby0FLwiQsj4IjzgUmMiE - GCM_SENDER_ID - 394751167018 - PLIST_VERSION - 1 - BUNDLE_ID - co.nimblehq.ios.templates.staging - PROJECT_ID - nimble-ios-template - STORAGE_BUCKET - nimble-ios-template.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:394751167018:ios:7670aacd2a018cd5b21153 - \ No newline at end of file + + From 17a544b1b65beee5af728f9a2427f31531c6fee0 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 12 Apr 2023 13:42:31 +0700 Subject: [PATCH 42/56] [#471] Update test deploy build to firebase with latest action version Update make.sh remove set_up_test_firebase.sh after run --- .github/workflows/test_upload_build_to_firebase.yml | 8 ++++---- make.sh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index e957f446..f7f370da 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -19,12 +19,12 @@ jobs: runs-on: macOS-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install SSH key - uses: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} @@ -37,7 +37,7 @@ jobs: run: bundle install - name: Cache Pods - uses: actions/cache@v2 + uses: actions/cache@v3 id: cocoapodCache with: path: Pods @@ -48,7 +48,7 @@ jobs: - name: Start Install Script for Template App run: sh make.sh --bundle-id co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp - - name: Start Setup Script for Template App Firebase Upload + - name: Start Setup Script for Template App TestFlight Upload run: sh set_up_test_firebase.sh env: MATCH_REPO: ${{ secrets.MATCH_REPO }} diff --git a/make.sh b/make.sh index 25c00fbc..1d9cef17 100644 --- a/make.sh +++ b/make.sh @@ -192,6 +192,7 @@ git reset if [[ -z "${CI}" ]]; then rm -rf fastlane/Tests + rm -f set_up_test_firebase.sh rm -f set_up_test_testflight.sh sh deliverable_setup.sh fi From 09e9454e5cc8f4e1d8a2098913fb10d85a4bd393 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 14 Apr 2023 13:41:29 +0700 Subject: [PATCH 43/56] [#471] Update Fastfile --- fastlane/Fastfile.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index a515a3d4..1f8cfa75 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -35,7 +35,7 @@ class Fastfile: LaneFile { appIdentifier: [Constant.stagingBundleId] ) } - + func syncAdHocProductionCodeSigningLane() { desc("Sync the Ad Hoc match signing for the Production build") Match.syncCodeSigning( From eb8b11f6a805f193f6be5a43c0f25dc10076e3e1 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 19 Apr 2023 13:52:00 +0700 Subject: [PATCH 44/56] [#471] Update Rebase conflict --- fastlane/Fastfile.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 1f8cfa75..b1dc07bd 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -32,7 +32,7 @@ class Fastfile: LaneFile { desc("Sync the Ad Hoc match signing for the Staging build") Match.syncCodeSigning( type: .adHoc, - appIdentifier: [Constant.stagingBundleId] + environment: .staging ) } From a54845e88bb02ab22e362d345899cf88a6fc06dc Mon Sep 17 00:00:00 2001 From: David Date: Wed, 19 Apr 2023 14:37:15 +0700 Subject: [PATCH 45/56] [#471] Update set team Id in set up test firebase --- set_up_test_firebase.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index 276765a5..dc4a68b3 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -7,6 +7,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_STAGING_FIREBASE_APP_ID/$STAGING_FIREBASE_APP_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_FIREBASE_TESTER_GROUPS/nimble/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From ccd8c208594cb50cbba151818f51c64bb57ea422 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 19 Apr 2023 14:55:38 +0700 Subject: [PATCH 46/56] [#471] Update set team Id in set up test firebase --- set_up_test_firebase.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index dc4a68b3..d11d0861 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -1,5 +1,6 @@ echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null +readonly CONSTANT_TEAM_ID="<#teamId#>" readonly CONSTANT_STAGING_FIREBASE_APP_ID="<#stagingFirebaseAppId#>" readonly CONSTANT_FIREBASE_TESTER_GROUPS="<#group1#>, <#group2#>" readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" From fb2086db184cd96b0c73f927e7c83d4d9527e655 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 20 Apr 2023 14:11:36 +0700 Subject: [PATCH 47/56] [#471] Update set team Id from env variable --- .github/workflows/test_upload_build_to_firebase.yml | 2 ++ set_up_test_firebase.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index f7f370da..a8aea8c0 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -5,6 +5,7 @@ name: Test Upload Build to Firebase ### MATCH_PASS ### FIREBASE_TOKEN ### STAGING_FIREBASE_APP_ID +### TEAM_ID on: pull_request @@ -53,6 +54,7 @@ jobs: env: MATCH_REPO: ${{ secrets.MATCH_REPO }} STAGING_FIREBASE_APP_ID: ${{ secrets.STAGING_FIREBASE_APP_ID }} + TEAM_ID: ${{ secrets.TEAM_ID }} - name: Set Up Test Project for Firebase run: bundle exec fastlane setUpTestProject diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index d11d0861..c9c4e5e7 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -8,7 +8,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_STAGING_FIREBASE_APP_ID/$STAGING_FIREBASE_APP_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_FIREBASE_TESTER_GROUPS/nimble/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 1c89d91f88d7285e4c6b86f085a1152b7f8f9e16 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 20 Apr 2023 15:36:59 +0700 Subject: [PATCH 48/56] [#471] Remove redundant code --- set_up_test_firebase.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index c9c4e5e7..e551f565 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -1,5 +1,3 @@ -echo "import('./Tests/Fastfile')" | cat - fastlane/Fastfile | tee fastlane/Fastfile &> /dev/null - readonly CONSTANT_TEAM_ID="<#teamId#>" readonly CONSTANT_STAGING_FIREBASE_APP_ID="<#stagingFirebaseAppId#>" readonly CONSTANT_FIREBASE_TESTER_GROUPS="<#group1#>, <#group2#>" From b3b65c3c1b6f2f16f8de066b7253413375ecf58a Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 13:23:29 +0700 Subject: [PATCH 49/56] [#471] Hard code teamId --- set_up_test_firebase.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index e551f565..2df4414c 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -6,7 +6,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_STAGING_FIREBASE_APP_ID/$STAGING_FIREBASE_APP_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_FIREBASE_TESTER_GROUPS/nimble/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 3be90139e0978608145065b2c14e5e8899d2d66b Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 15:05:23 +0700 Subject: [PATCH 50/56] [310] Reposition the connectAPIKey command to be consistent with buildAndUploadToTestFlightLane --- fastlane/Fastfile.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index ccba6fe1..09efc269 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -107,7 +107,6 @@ class Fastfile: LaneFile { desc("Build Production app and upload to App Store") setAppVersion() - AppStoreAuthentication.connectAPIKey() if Secret.bumpAppStoreBuildNumber { bumpAppstoreBuild() } else { @@ -116,6 +115,7 @@ class Fastfile: LaneFile { buildAppStoreLane() + AppStoreAuthentication.connectAPIKey() Distribution.uploadToAppStore() Symbol.uploadToCrashlytics(environment: .production) From 43d95424a4709659a7edb4be225dbd36d1a2dde3 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Apr 2023 15:19:28 +0700 Subject: [PATCH 51/56] [310] Revert --- fastlane/Fastfile.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 09efc269..ccba6fe1 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -107,6 +107,7 @@ class Fastfile: LaneFile { desc("Build Production app and upload to App Store") setAppVersion() + AppStoreAuthentication.connectAPIKey() if Secret.bumpAppStoreBuildNumber { bumpAppstoreBuild() } else { @@ -115,7 +116,6 @@ class Fastfile: LaneFile { buildAppStoreLane() - AppStoreAuthentication.connectAPIKey() Distribution.uploadToAppStore() Symbol.uploadToCrashlytics(environment: .production) From 92e34eb6610606f3454975cdc9f1b25b1b80fd95 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 26 Apr 2023 11:31:16 +0700 Subject: [PATCH 52/56] [#471] Update workflow name Match to Sync --- .github/workflows/test_upload_build_to_firebase.yml | 2 +- .github/workflows/test_upload_build_to_test_flight.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index a8aea8c0..698e5deb 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -59,7 +59,7 @@ jobs: - name: Set Up Test Project for Firebase run: bundle exec fastlane setUpTestProject - - name: Match Ad-hoc + - name: Sync Ad Hoc Code Signing run: bundle exec fastlane syncAdHocStagingCodeSigning env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} diff --git a/.github/workflows/test_upload_build_to_test_flight.yml b/.github/workflows/test_upload_build_to_test_flight.yml index 741fe41b..b0764479 100644 --- a/.github/workflows/test_upload_build_to_test_flight.yml +++ b/.github/workflows/test_upload_build_to_test_flight.yml @@ -57,7 +57,7 @@ jobs: - name: Set Up Test Project for App Store run: bundle exec fastlane setUpTestProject - - name: Match Appstore + - name: Sync App Store Code Signing run: bundle exec fastlane syncAppStoreCodeSigning env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} From b9c243b7e533b266afa1137cdac8645bc752b591 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 26 Apr 2023 11:33:15 +0700 Subject: [PATCH 53/56] [#471] Use TEAM_ID environment variable to set up test firebase and set up test testflight --- set_up_test_firebase.sh | 2 +- set_up_test_testflight.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/set_up_test_firebase.sh b/set_up_test_firebase.sh index 2df4414c..e551f565 100644 --- a/set_up_test_firebase.sh +++ b/set_up_test_firebase.sh @@ -6,7 +6,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_STAGING_FIREBASE_APP_ID/$STAGING_FIREBASE_APP_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_FIREBASE_TESTER_GROUPS/nimble/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index 5428a5c2..c1e1290e 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -6,7 +6,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 68aef4804a282988bac4f9bd4d5c80e3e2916c4c Mon Sep 17 00:00:00 2001 From: David Date: Wed, 26 Apr 2023 11:34:24 +0700 Subject: [PATCH 54/56] [310] Update format code --- fastlane/Constants/Constant.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/Constants/Constant.swift b/fastlane/Constants/Constant.swift index c77b3cee..ae8ddf83 100644 --- a/fastlane/Constants/Constant.swift +++ b/fastlane/Constants/Constant.swift @@ -84,14 +84,14 @@ extension Constant { case production = "Production" var productName: String { "\(Constant.projectName) \(rawValue)".trimmed } - + var scheme: String { switch self { case .staging: return "\(Constant.projectName) \(rawValue)".trimmed case .production: return Constant.projectName.trimmed } } - + var bundleId: String { switch self { case .staging: return Constant.stagingBundleId From 67d66bac83466a6668fa623b5a36844017ce7d6c Mon Sep 17 00:00:00 2001 From: David Date: Fri, 28 Apr 2023 09:32:46 +0700 Subject: [PATCH 55/56] [#330] Update set teamId from env variable in set_up_test_testflight.sh --- set_up_test_testflight.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/set_up_test_testflight.sh b/set_up_test_testflight.sh index 5428a5c2..c1e1290e 100644 --- a/set_up_test_testflight.sh +++ b/set_up_test_testflight.sh @@ -6,7 +6,7 @@ readonly CONSTANT_MATCH_REPO="git@github.com:{organization}\/{repo}.git" readonly WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) MATCH_REPO_ESCAPED=$(echo "${MATCH_REPO//\//\\\/}") -LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/4TWS7E2EPE/g" {} + +LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_TEAM_ID/$TEAM_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_API_KEY_ID/$API_KEY_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_ISSUER_ID/$ISSUER_ID/g" {} + LC_ALL=C find $WORKING_DIR -type f -exec sed -i "" "s/$CONSTANT_MATCH_REPO/$MATCH_REPO_ESCAPED/g" {} + From 6d6f71b86453e425c9a3af0311272f9d6b5fd98f Mon Sep 17 00:00:00 2001 From: David Date: Fri, 28 Apr 2023 11:51:05 +0700 Subject: [PATCH 56/56] [#471] Update name --- .github/workflows/test_upload_build_to_firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_upload_build_to_firebase.yml b/.github/workflows/test_upload_build_to_firebase.yml index 698e5deb..e27af9e3 100644 --- a/.github/workflows/test_upload_build_to_firebase.yml +++ b/.github/workflows/test_upload_build_to_firebase.yml @@ -49,7 +49,7 @@ jobs: - name: Start Install Script for Template App run: sh make.sh --bundle-id co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp - - name: Start Setup Script for Template App TestFlight Upload + - name: Start Setup Script for Template App Firebase Upload run: sh set_up_test_firebase.sh env: MATCH_REPO: ${{ secrets.MATCH_REPO }}