Skip to content

Commit

Permalink
Clone to spm using fastlane (#3926)
Browse files Browse the repository at this point in the history
This moves the logic for cloning the repo out of the CircleCI .yml file
to a new fastlane lane.

Companion PR:
RevenueCat/fastlane-plugin-revenuecat_internal#65
  • Loading branch information
jamesrb1 authored and nyeu committed Oct 1, 2024
1 parent 5c61ffb commit 7ceeb2d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ceeb2d

Please sign in to comment.