Skip to content

Commit 648e4c7

Browse files
author
Di Wu
authored
Merge pull request #2992 from aws-amplify/5d/fix-unstable-release-lane
ci(v1): read CocoaPods token before publishing
2 parents 1eedcd6 + af93398 commit 648e4c7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fastlane/Fastfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ platform :ios do
3535

3636
desc "Create a release version by building and committing a changelog, pushing a tag to GitHub, and pushing pods to CocoaPods"
3737
lane :release do
38-
# Define `COCOAPODS_TRUNK_TOKEN` env var for trunk authentication
39-
# https://github.com/CocoaPods/cocoapods-trunk/commit/9e6ec1c1faf96fa837dc2ed70b5f54006b181ed6
40-
secret = sh(
41-
command: 'aws secretsmanager get-secret-value --secret-id ${COCOAPODS_SECRET_ARN}',
42-
log: false
43-
)
44-
45-
ENV['COCOAPODS_TRUNK_TOKEN'] = JSON.parse(secret)["SecretString"]
46-
4738
next_version, commits = calculate_next_release_version(version_limit:'v2.0.0')
4839
if next_version >= '2.0.0'
4940
UI.message("Received version: #{next_version}, exiting lane because version is larger than 2.0.0")
@@ -116,6 +107,15 @@ platform :ios do
116107

117108
desc "Release pods"
118109
private_lane :release_pods do
110+
# Define `COCOAPODS_TRUNK_TOKEN` env var for trunk authentication
111+
# https://github.com/CocoaPods/cocoapods-trunk/commit/9e6ec1c1faf96fa837dc2ed70b5f54006b181ed6
112+
secret = sh(
113+
command: 'aws secretsmanager get-secret-value --secret-id ${COCOAPODS_SECRET_ARN}',
114+
log: false
115+
)
116+
117+
ENV['COCOAPODS_TRUNK_TOKEN'] = JSON.parse(secret)["SecretString"]
118+
119119
AmplifyPods.pods.each do |pod|
120120
if pod[:no_push]
121121
UI.message "Skipping pushing pod #{pod[:spec]}"

0 commit comments

Comments
 (0)