@@ -19,14 +19,28 @@ TESTINGMODE=${1-}
19
19
if [ -f " ${HOME} /.cocoapods/repos" ]; then
20
20
find " ${HOME} /.cocoapods/repos" -type d -maxdepth 1 -exec sh -c ' pod repo remove $(basename {})' \;
21
21
fi
22
- git config --global user.email
" [email protected] "
23
- git config --global user.name " google-oss-bot"
24
- mkdir -p /tmp/test/firebase-ios-sdk
22
+
23
+ mkdir -p " ${local_sdk_repo_dir} "
25
24
echo " git clone ${podspec_repo_branch} from github.com/firebase/firebase-ios-sdk.git to ${local_sdk_repo_dir} "
26
25
set +x
27
- git clone -q -b " ${podspec_repo_branch} " https://" ${BOT_TOKEN} " @github.com/firebase/firebase-ios-sdk.git " ${local_sdk_repo_dir} "
26
+ git clone -q https://" ${BOT_TOKEN} " @github.com/firebase/firebase-ios-sdk.git " ${local_sdk_repo_dir} "
28
27
set -x
29
28
29
+ cd " ${local_sdk_repo_dir} "
30
+ # This is to search Cocoapods-X.Y.Z tags from all branches of the sdk repo and test_version is X.Y.Z
31
+ test_version=$( git tag -l --sort=-version:refname CocoaPods-* [0-9] | head -n 1 | sed -n ' s/CocoaPods-//p' )
32
+ # Check if release-X.Y.Z branch exists in the remote repo.
33
+ release_branch=$( git branch -r -l " origin/release-${test_version} " )
34
+ if [ -z $release_branch ]; then
35
+ echo " release-${test_version} branch does not exist in the sdk repo."
36
+ exit 1
37
+ fi
38
+
39
+ # Get release branch, release-X.Y.Z.
40
+ podspec_repo_branch=$( echo $release_branch | sed -n ' s/\s*origin\///p' )
41
+
42
+ git config --global user.email
" [email protected] "
43
+ git config --global user.name " google-oss-bot"
30
44
if [ " $TESTINGMODE " = " nightly_testing" ]; then
31
45
tag_version=" nightly-test-${test_version} "
32
46
echo " A new tag, ${tag_version} ,for nightly release testing will be created."
@@ -37,7 +51,7 @@ if [ "$TESTINGMODE" = "RC_testing" ]; then
37
51
fi
38
52
# Update a tag.
39
53
if [ -n " $tag_version " ]; then
40
- cd " ${local_sdk_repo_dir } "
54
+ git checkout " ${podspec_repo_branch } "
41
55
set +e
42
56
# If tag_version is new to the remote, remote cannot delete a non-existent
43
57
# tag, so error is allowed here.
0 commit comments