From 465bed868b28e22bafed67d7247eb79ba316a3de Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Mon, 11 Dec 2023 08:30:36 -0800 Subject: [PATCH] `CircleCI`: add git credentials to snapshot generation (#3506) --- .circleci/config.yml | 89 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0a7c5c008..5b9b607671 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -279,6 +279,23 @@ commands: command: | bundle exec fastlane update_carthage_commit + create-snapshot-pr-if-needed: + parameters: + version: + type: string + job: + type: string + condition: + type: boolean + steps: + - when: + condition: << parameters.condition >> + steps: + - setup-git-credentials + - run: + name: Run << parameters.job >> + command: bundle exec fastlane << parameters.job >> version:"<< parameters.version >>" + jobs: spm-release-build-xcode-14: <<: *base-job @@ -344,12 +361,10 @@ jobs: no_output_timeout: 5m environment: SCAN_DEVICE: iPhone 13,OS=15.5 - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_revenuecatui_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshots_repo_pr version:"revenuecatui-15" + job: "create_snapshots_repo_pr" + version: "revenuecatui-15" - compress_result_bundle: directory: fastlane/test_output bundle_name: revenuecatui @@ -374,12 +389,10 @@ jobs: no_output_timeout: 5m environment: SCAN_DEVICE: iPhone 14,OS=16.4 - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_revenuecatui_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshots_repo_pr version:"revenuecatui-16" + job: "create_snapshots_repo_pr" + version: "revenuecatui-16" - compress_result_bundle: directory: fastlane/test_output bundle_name: revenuecatui @@ -407,12 +420,10 @@ jobs: no_output_timeout: 15m environment: SCAN_DEVICE: iPhone 15 Pro,OS=17.2 - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_revenuecatui_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshots_repo_pr version:"revenuecatui-17" + job: "create_snapshots_repo_pr" + version: "revenuecatui-17" - compress_result_bundle: directory: fastlane/test_output bundle_name: revenuecatui @@ -459,12 +470,10 @@ jobs: - compress_result_bundle: directory: fastlane/test_output/xctest/ios bundle_name: RevenueCat - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshot_pr version:"ios-17" + job: "create_snapshot_pr" + version: "ios-17" - store_test_results: path: fastlane/test_output - store_artifacts: @@ -488,12 +497,10 @@ jobs: - compress_result_bundle: directory: fastlane/test_output/xctest/ios bundle_name: RevenueCat - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshot_pr version:"ios-16" + job: "create_snapshot_pr" + version: "ios-16" - store_test_results: path: fastlane/test_output - store_artifacts: @@ -515,12 +522,10 @@ jobs: - compress_result_bundle: directory: fastlane/test_output/xctest/ios bundle_name: RevenueCat - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshot_pr version:"ios-15" + job: "create_snapshot_pr" + version: "ios-15" - store_test_results: path: fastlane/test_output - store_artifacts: @@ -580,12 +585,10 @@ jobs: - compress_result_bundle: directory: fastlane/test_output/xctest/ios bundle_name: RevenueCat - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshot_pr version:"ios-14" + job: "create_snapshot_pr" + version: "ios-14" - store_test_results: path: fastlane/test_output - store_artifacts: @@ -609,12 +612,10 @@ jobs: - compress_result_bundle: directory: fastlane/test_output/xctest/ios bundle_name: RevenueCat - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshot_pr version:"ios-13" + job: "create_snapshot_pr" + version: "ios-13" - store_test_results: path: fastlane/test_output - store_artifacts: @@ -638,12 +639,10 @@ jobs: - compress_result_bundle: directory: fastlane/test_output/xctest/ios bundle_name: RevenueCat - - when: + - create-snapshot-pr-if-needed: condition: << pipeline.parameters.generate_snapshots >> - steps: - - run: - name: Run create_snapshot_pr - command: bundle exec fastlane create_snapshot_pr version:"ios-12" + job: "create_snapshot_pr" + version: "ios-12" - store_test_results: path: fastlane/test_output - store_artifacts: