From c8d007ca434423e724399acd0bc3ee4e9befb5cb Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 16:41:49 -0700 Subject: [PATCH 01/17] New lane that will make the SPM clone So that the git commands can be removed from the .yml file. This commit contains test targets (sync-to-spm-repo branch and spm3.git). --- fastlane/Fastfile | 10 ++++++++++ fastlane/Pluginfile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1befb596ef..c5a9e6f06d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -876,6 +876,16 @@ platform :ios do update_snapshots_commit(new_hash) end + lane :deploy_to_spm do + source_repo = ENV["CIRCLE_REPOSITORY_URL"] + destination_repo = source_repo.sub(/\.git\z/, "-spm3.git") + + git_clone_and_push( + source_repo: source_repo, + destination_repo: destination_repo + ) + end + desc "Create or delete sandbox testers" lane :sandbox_testers do Spaceship::ConnectAPI.login(use_portal: false) diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 7d7eb08200..6ed8892aa2 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -3,4 +3,4 @@ # Ensure this file is checked in to source control! gem 'fastlane-plugin-create_xcframework' -gem "fastlane-plugin-revenuecat_internal", git: "https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal" +gem 'fastlane-plugin-revenuecat_internal', git: 'https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal', branch: 'sync-to-spm-repo' From 02dc90825173ba919cdc391fdc2edd42367c053a Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 16:51:24 -0700 Subject: [PATCH 02/17] New `spm-deploy` test workflow --- .circleci/config.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 585183a6a2..637b475a75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1158,6 +1158,15 @@ jobs: git push origin git push --tags + deploy-to-spm-fastlane: + docker: + - image: cimg/base:stable + resource_class: small + steps: + - run: + name: Clone purchases-ios and push to purchases-ios-spm + command: bundle exec fastlane deploy_to_spm + workflows: version: 2 generate-snapshot: @@ -1340,6 +1349,9 @@ workflows: danger: jobs: - danger + spm-deploy: + jobs: + - deploy-to-spm-fastlane weekly-run-workflow: when: and: From 7c54a68fe6817a2c6a080d586b6bd89e52777331 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 16:52:49 -0700 Subject: [PATCH 03/17] Indentation fix --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 637b475a75..5f7680ae7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1159,13 +1159,13 @@ jobs: git push --tags deploy-to-spm-fastlane: - docker: - - image: cimg/base:stable - resource_class: small - steps: - - run: - name: Clone purchases-ios and push to purchases-ios-spm - command: bundle exec fastlane deploy_to_spm + docker: + - image: cimg/base:stable + resource_class: small + steps: + - run: + name: Clone purchases-ios and push to purchases-ios-spm + command: bundle exec fastlane deploy_to_spm workflows: version: 2 From 63f734c5b1ce848aba09040f328bc2f00a61554b Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 16:54:55 -0700 Subject: [PATCH 04/17] More indentation fix --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f7680ae7c..c216859e8f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1160,12 +1160,12 @@ jobs: deploy-to-spm-fastlane: docker: - - image: cimg/base:stable - resource_class: small - steps: - - run: - name: Clone purchases-ios and push to purchases-ios-spm - command: bundle exec fastlane deploy_to_spm + - image: cimg/base:stable + resource_class: small + steps: + - run: + name: Clone purchases-ios and push to purchases-ios-spm + command: bundle exec fastlane deploy_to_spm workflows: version: 2 From 9815414c6e89f69a4220311e495123634ef2271f Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 16:58:53 -0700 Subject: [PATCH 05/17] =?UTF-8?q?Don=E2=80=99t=20specify=20docker=E2=80=A6?= =?UTF-8?q?=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c216859e8f..47db541d7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1159,9 +1159,6 @@ jobs: git push --tags deploy-to-spm-fastlane: - docker: - - image: cimg/base:stable - resource_class: small steps: - run: name: Clone purchases-ios and push to purchases-ios-spm From cb9a4d8e41e4feaad205806edbe3315f8dfbe7a7 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 17:01:02 -0700 Subject: [PATCH 06/17] =?UTF-8?q?comeon=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 47db541d7a..3ac51076f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1159,6 +1159,10 @@ jobs: git push --tags deploy-to-spm-fastlane: + docker: + - image: cimg/ruby:3.1.2 + working_directory: ~/purchases-ios + shell: /bin/bash --login -o pipefail steps: - run: name: Clone purchases-ios and push to purchases-ios-spm From 8347cce235cbda303e68b45cdca8d0c7955fc191 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Thu, 30 May 2024 17:03:09 -0700 Subject: [PATCH 07/17] =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ac51076f4..4a3c98b3cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1164,6 +1164,7 @@ jobs: working_directory: ~/purchases-ios shell: /bin/bash --login -o pipefail steps: + - install-rubydocker-dependencies - run: name: Clone purchases-ios and push to purchases-ios-spm command: bundle exec fastlane deploy_to_spm From b45388e456f14649a1a777d2e96078099b260cb2 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Fri, 31 May 2024 09:08:00 -0700 Subject: [PATCH 08/17] base job --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a3c98b3cf..cf5a874b7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1159,12 +1159,8 @@ jobs: git push --tags deploy-to-spm-fastlane: - docker: - - image: cimg/ruby:3.1.2 - working_directory: ~/purchases-ios - shell: /bin/bash --login -o pipefail + <<: *base-job steps: - - install-rubydocker-dependencies - run: name: Clone purchases-ios and push to purchases-ios-spm command: bundle exec fastlane deploy_to_spm From 3d9edce6e930729c20a7c2eb777e73d3c1138c74 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Fri, 31 May 2024 09:12:01 -0700 Subject: [PATCH 09/17] checkout --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf5a874b7d..56c7d5db98 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1161,6 +1161,7 @@ jobs: deploy-to-spm-fastlane: <<: *base-job steps: + - checkout - run: name: Clone purchases-ios and push to purchases-ios-spm command: bundle exec fastlane deploy_to_spm From a283015d72e2058544ced602fffcf1f9fbea1864 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Fri, 31 May 2024 09:15:56 -0700 Subject: [PATCH 10/17] use command --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56c7d5db98..ce1e4f3a85 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1162,10 +1162,11 @@ jobs: <<: *base-job steps: - checkout + - install-bundle-dependencies - run: name: Clone purchases-ios and push to purchases-ios-spm command: bundle exec fastlane deploy_to_spm - + workflows: version: 2 generate-snapshot: From 3f2711185dfe562b221e22f7ea773e6862f678e1 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Fri, 31 May 2024 09:31:38 -0700 Subject: [PATCH 11/17] Make fastlane deploy-to-spm use fastlane --- .circleci/config.yml | 17 ----------------- fastlane/Pluginfile | 2 +- fastlane/README.md | 8 ++++++++ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce1e4f3a85..24af83d0c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1142,23 +1142,6 @@ jobs: } deploy-to-spm: - docker: - - image: cimg/base:stable - resource_class: small - steps: - - checkout - - setup-git-credentials - - run: - name: Clone purchases-ios and push to purchases-ios-spm - command: | - git clone https://github.com/RevenueCat/purchases-ios.git - cd purchases-ios - git fetch --tags - git remote set-url origin https://github.com/RevenueCat/purchases-ios-spm.git - git push origin - git push --tags - - deploy-to-spm-fastlane: <<: *base-job steps: - checkout diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 6ed8892aa2..7d7eb08200 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -3,4 +3,4 @@ # Ensure this file is checked in to source control! gem 'fastlane-plugin-create_xcframework' -gem 'fastlane-plugin-revenuecat_internal', git: 'https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal', branch: 'sync-to-spm-repo' +gem "fastlane-plugin-revenuecat_internal", git: "https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal" diff --git a/fastlane/README.md b/fastlane/README.md index 93d286e2d6..9f026b1a5f 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -354,6 +354,14 @@ Clones or updates snapshots repo Updates purchases-ios-snapshots-commit to point to latest commit on main +### ios deploy_to_spm + +```sh +[bundle exec] fastlane ios deploy_to_spm +``` + + + ### ios sandbox_testers ```sh From 1f248c6fb706356bab9b78bc6953e98f340ef4d8 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Fri, 31 May 2024 09:34:14 -0700 Subject: [PATCH 12/17] Delete test workflow --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 24af83d0c4..c413431802 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1332,9 +1332,6 @@ workflows: danger: jobs: - danger - spm-deploy: - jobs: - - deploy-to-spm-fastlane weekly-run-workflow: when: and: From 259e559c7d79b39852e7796ddfd66bf2069379f7 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Fri, 31 May 2024 09:37:08 -0700 Subject: [PATCH 13/17] Aim at correct destination repo --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c5a9e6f06d..59700d6c9b 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -878,7 +878,7 @@ platform :ios do lane :deploy_to_spm do source_repo = ENV["CIRCLE_REPOSITORY_URL"] - destination_repo = source_repo.sub(/\.git\z/, "-spm3.git") + destination_repo = source_repo.sub(/\.git\z/, "-spm.git") git_clone_and_push( source_repo: source_repo, From 06bd6a04506e90a1dc1ec40933ab29851db25d15 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Tue, 18 Jun 2024 11:31:55 -0700 Subject: [PATCH 14/17] Construct URL if env var does not exist --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 49d50d98a9..b9757d6e12 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -877,7 +877,7 @@ platform :ios do end lane :deploy_to_spm do - source_repo = ENV["CIRCLE_REPOSITORY_URL"] + source_repo = ENV["CIRCLE_REPOSITORY_URL"] || "https://github.com/revenuecat/#{repo_name}" destination_repo = source_repo.sub(/\.git\z/, "-spm.git") git_clone_and_push( From c627b43831d866bb7c40ad23c681258312c13d09 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Tue, 18 Jun 2024 12:04:52 -0700 Subject: [PATCH 15/17] Move to ruby --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f39b9f7472..12665ad2b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1151,10 +1151,13 @@ jobs: } deploy-to-spm: - <<: *base-job + docker: + - image: cimg/ruby:3.1.2 + working_directory: ~/purchases-ios + shell: /bin/bash --login -o pipefail steps: - checkout - - install-bundle-dependencies + - install-rubydocker-dependencies - run: name: Clone purchases-ios and push to purchases-ios-spm command: bundle exec fastlane deploy_to_spm From fda06d10a5987f1c1aac488164de9f21fd2c2c2c Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Tue, 18 Jun 2024 12:12:34 -0700 Subject: [PATCH 16/17] Test ruby push to test spm3 repo --- .circleci/config.yml | 3 +++ fastlane/Fastfile | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 12665ad2b8..665cd6d393 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1348,6 +1348,9 @@ workflows: danger: jobs: - danger + spm-test-deploy: + jobs: + - deploy-to-spm weekly-run-workflow: when: and: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index b9757d6e12..ea6c2b5ddd 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -878,8 +878,8 @@ platform :ios do lane :deploy_to_spm do source_repo = ENV["CIRCLE_REPOSITORY_URL"] || "https://github.com/revenuecat/#{repo_name}" - destination_repo = source_repo.sub(/\.git\z/, "-spm.git") - + destination_repo = source_repo.sub(/\.git\z/, "-spm3.git") + git_clone_and_push( source_repo: source_repo, destination_repo: destination_repo From e3d99ad03cf6cd15ebf96e7d122d41cf395857d6 Mon Sep 17 00:00:00 2001 From: James Borthwick Date: Tue, 18 Jun 2024 12:15:01 -0700 Subject: [PATCH 17/17] Revert "Test ruby push to test spm3 repo" This reverts commit fda06d10a5987f1c1aac488164de9f21fd2c2c2c. --- .circleci/config.yml | 3 --- fastlane/Fastfile | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 665cd6d393..12665ad2b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1348,9 +1348,6 @@ workflows: danger: jobs: - danger - spm-test-deploy: - jobs: - - deploy-to-spm weekly-run-workflow: when: and: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index ea6c2b5ddd..b9757d6e12 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -878,8 +878,8 @@ platform :ios do lane :deploy_to_spm do source_repo = ENV["CIRCLE_REPOSITORY_URL"] || "https://github.com/revenuecat/#{repo_name}" - destination_repo = source_repo.sub(/\.git\z/, "-spm3.git") - + destination_repo = source_repo.sub(/\.git\z/, "-spm.git") + git_clone_and_push( source_repo: source_repo, destination_repo: destination_repo