From 7ceeb2db5819801024adf9a28ed45aa48d8af595 Mon Sep 17 00:00:00 2001 From: James Borthwick <109382862+jamesrb1@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:06:24 -0700 Subject: [PATCH] Clone to spm using fastlane (#3926) This moves the logic for cloning the repo out of the CircleCI .yml file to a new fastlane lane. Companion PR: https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal/pull/65 --- .circleci/config.yml | 17 ++++++----------- fastlane/Fastfile | 10 ++++++++++ fastlane/README.md | 8 ++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index deea1338bb..12665ad2b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1152,21 +1152,16 @@ jobs: deploy-to-spm: docker: - - image: cimg/base:stable - resource_class: small + - image: cimg/ruby:3.1.2 + working_directory: ~/purchases-ios + shell: /bin/bash --login -o pipefail steps: - checkout - - setup-git-credentials + - install-rubydocker-dependencies - 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 - + command: bundle exec fastlane deploy_to_spm + workflows: version: 2 generate-snapshot: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 6ad96efef4..b9757d6e12 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"] || "https://github.com/revenuecat/#{repo_name}" + destination_repo = source_repo.sub(/\.git\z/, "-spm.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/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