Skip to content

Commit 22d6a45

Browse files
authored
Update release setup to released tags. (#9221)
* Update release setup to released tags.
1 parent b50a3ef commit 22d6a45

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
# the latest release branch of this repo will be validated and pushed to
2222
# the testing repo.
2323
local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
24+
podspec_repo_branch: master
2425
runs-on: macos-11
2526
steps:
2627
- uses: actions/checkout@v2

scripts/release_testing_setup.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,26 @@ if [ -f "${HOME}/.cocoapods/repos" ]; then
2323
fi
2424

2525
mkdir -p "${local_sdk_repo_dir}"
26-
echo "git clone ${podspec_repo_branch} from github.com/firebase/firebase-ios-sdk.git to ${local_sdk_repo_dir}"
26+
echo "git clone from github.com/firebase/firebase-ios-sdk.git to ${local_sdk_repo_dir}"
2727
set +x
2828
# Using token here to update tags later.
2929
git clone -q https://"${BOT_TOKEN}"@github.com/firebase/firebase-ios-sdk.git "${local_sdk_repo_dir}"
3030
set -x
3131

3232
cd "${local_sdk_repo_dir}"
3333
# The chunk below is to determine the latest version by searching
34-
# Get the latest origin/release-X.Y.Z branch in the remote repo for release branch testing.
35-
release_branch=$(git branch -l -r --sort=-version:refname origin/release-* | head -n 1 )
36-
# Get the latest released tag Cocoapods-X.Y.Z for prerelease testing, beta version will be excluded.
34+
# Get the latest released tag Cocoapods-X.Y.Z for release and prerelease testing, beta version will be excluded.
3735
test_version=$(git tag -l --sort=-version:refname CocoaPods-*[0-9] | head -n 1)
3836

39-
if [ -z $podspec_repo_branch ];then
40-
# Get release branch, origin/release-X.Y.Z.
41-
podspec_repo_branch=$(echo $release_branch | sed -n 's/\s*//p')
42-
fi
43-
4437
git config --global user.email "[email protected]"
4538
git config --global user.name "google-oss-bot"
4639
git checkout "${podspec_repo_branch}"
4740
if [ "$TESTINGMODE" = "release_testing" ]; then
48-
# Latest release branch with prefix CocoaPods, e.g. CocoaPods-7.11
49-
latest_branch_version=$(git branch -l -r --sort=-v:refname origin/release-* | head -n 1 | sed -n 's/^[ \t]*origin\/release/CocoaPods/p' )
50-
# Latest tag of release branch on the repo, e.g. Cocoapods-7.9.0
51-
latest_release_branch_tag=$(git tag -l --sort=-version:refname "$latest_branch_version"*[0-9] | head -n 1)
52-
echo "Podspecs tags of Nightly release testing will be updated to ${latest_release_branch_tag}."
41+
git checkout "${test_version}"
42+
echo "Podspecs tags of Nightly release testing will be updated to ${test_version}."
5343
# Update source and tag, e.g. ":tag => 'CocoaPods-' + s.version.to_s" to
5444
# ":tag => 'CocoaPods-7.9.0'"
55-
sed -i "" "s/\s*:tag.*/:tag => '${latest_release_branch_tag}'/" *.podspec
45+
sed -i "" "s/\s*:tag.*/:tag => '${test_version}'/" *.podspec
5646
elif [ "$TESTINGMODE" = "prerelease_testing" ]; then
5747
tag_version="${test_version}.nightly"
5848
echo "A new tag, ${tag_version},for prerelease testing will be created."

0 commit comments

Comments
 (0)