Skip to content

Commit 5ce6167

Browse files
authored
Update versions automation (#6550)
1 parent f6642ef commit 5ce6167

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

.github/workflows/prerelease.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
bot_token_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
1717
local_repo: specstesting
1818
local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
19-
nightly_version: 6.33.0
20-
podspec_repo_branch: release-6.33.0
2119
runs-on: macOS-latest
2220
steps:
2321
- uses: actions/checkout@v2

scripts/release_testing_setup.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,28 @@ TESTINGMODE=${1-}
1919
if [ -f "${HOME}/.cocoapods/repos" ]; then
2020
find "${HOME}/.cocoapods/repos" -type d -maxdepth 1 -exec sh -c 'pod repo remove $(basename {})' \;
2121
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}"
2524
echo "git clone ${podspec_repo_branch} from github.com/firebase/firebase-ios-sdk.git to ${local_sdk_repo_dir}"
2625
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}"
2827
set -x
2928

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"
3044
if [ "$TESTINGMODE" = "nightly_testing" ]; then
3145
tag_version="nightly-test-${test_version}"
3246
echo "A new tag, ${tag_version},for nightly release testing will be created."
@@ -37,7 +51,7 @@ if [ "$TESTINGMODE" = "RC_testing" ]; then
3751
fi
3852
# Update a tag.
3953
if [ -n "$tag_version" ]; then
40-
cd "${local_sdk_repo_dir}"
54+
git checkout "${podspec_repo_branch}"
4155
set +e
4256
# If tag_version is new to the remote, remote cannot delete a non-existent
4357
# tag, so error is allowed here.

0 commit comments

Comments
 (0)