Skip to content

Commit 72eab78

Browse files
authored
Fix pod install of sample when updating phc (#954)
`update_sample_podfile_lock_with_retry` was failing with missing `sample_path`
1 parent 56dae82 commit 72eab78

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.circleci/config.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,13 @@ jobs:
178178

179179
update-hybrid-common-versions:
180180
description: "Creates a PR updating purchases-hybrid-common to latest release"
181-
docker:
182-
- image: cimg/ruby:3.3.0-node
181+
executor:
182+
name: rn/macos
183+
resource_class: macos.x86.medium.gen2
184+
xcode_version: 14.3.1
183185
steps:
184186
- checkout
185-
- revenuecat/install-gem-unix-dependencies:
187+
- revenuecat/install-gem-mac-dependencies:
186188
cache-version: v1
187189
- revenuecat/trust-github-key
188190
- revenuecat/setup-git-credentials

fastlane/Fastfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ lane :update_hybrid_common do |options|
163163
sh('yarn install --no-immutable')
164164
commit_current_changes(commit_message: 'Update yarn.lock')
165165

166+
# Pushing now in case updating podfile fails and needs to retry
167+
push_to_git_remote(set_upstream: true)
168+
166169
# This will update both PurchasesHybridCommonUI and PurchasesHybridCommon
167-
update_sample_podfile_lock_with_retry('PurchasesHybridCommonUI')
170+
update_sample_podfile_lock_with_retry(pod_name: 'PurchasesHybridCommonUI')
168171

169172
push_to_git_remote(set_upstream: true)
170173
end
@@ -248,12 +251,6 @@ def get_phc_version
248251
end
249252
end
250253

251-
def parse_pod_version
252-
Dir.chdir(get_root_folder) do
253-
return sh("cat #{sample_path}/ios/Podfile.lock | grep \' Purchases (=\' | awk \'{print($4)}\' | sed \"s/)//g\"").strip
254-
end
255-
end
256-
257254
def get_root_folder
258255
return File.expand_path('../../', __FILE__)
259256
end
@@ -268,7 +265,9 @@ def check_no_git_tag_exists(version_number)
268265
end
269266
end
270267

271-
def update_sample_podfile_lock_with_retry(pod_name)
268+
private_lane :update_sample_podfile_lock_with_retry do |options|
269+
pod_name = options[:pod_name]
270+
272271
retry_attempts = 4 # Total of 4 retries, with the first attempt considered, equals 5 attempts over 20 minutes
273272
Dir.chdir(File.expand_path("#{sample_path}/ios", get_root_folder)) do
274273
begin

0 commit comments

Comments
 (0)