Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update versions automation #6550

Merged
merged 9 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
bot_token_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
local_repo: specstesting
local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
nightly_version: 6.33.0
podspec_repo_branch: release-6.33.0
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 19 additions & 5 deletions scripts/release_testing_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,28 @@ TESTINGMODE=${1-}
if [ -f "${HOME}/.cocoapods/repos" ]; then
find "${HOME}/.cocoapods/repos" -type d -maxdepth 1 -exec sh -c 'pod repo remove $(basename {})' \;
fi
git config --global user.email "[email protected]"
git config --global user.name "google-oss-bot"
mkdir -p /tmp/test/firebase-ios-sdk

mkdir -p "${local_sdk_repo_dir}"
echo "git clone ${podspec_repo_branch} from github.com/firebase/firebase-ios-sdk.git to ${local_sdk_repo_dir}"
set +x
git clone -q -b "${podspec_repo_branch}" https://"${BOT_TOKEN}"@github.com/firebase/firebase-ios-sdk.git "${local_sdk_repo_dir}"
git clone -q https://"${BOT_TOKEN}"@github.com/firebase/firebase-ios-sdk.git "${local_sdk_repo_dir}"
set -x

cd "${local_sdk_repo_dir}"
# This is to search Cocoapods-X.Y.Z tags from all branches of the sdk repo and test_version is X.Y.Z
test_version=$(git tag -l --sort=-version:refname CocoaPods-*[0-9] | head -n 1 | sed -n 's/CocoaPods-//p')
# Check if release-X.Y.Z branch exists in the remote repo.
release_branch=$(git branch -r -l "origin/release-${test_version}")
if [ -z $release_branch ];then
echo "release-${test_version} branch does not exist in the sdk repo."
exit 1
fi

# Get release branch, release-X.Y.Z.
podspec_repo_branch=$(echo $release_branch | sed -n 's/\s*origin\///p')

git config --global user.email "[email protected]"
git config --global user.name "google-oss-bot"
if [ "$TESTINGMODE" = "nightly_testing" ]; then
tag_version="nightly-test-${test_version}"
echo "A new tag, ${tag_version},for nightly release testing will be created."
Expand All @@ -37,7 +51,7 @@ if [ "$TESTINGMODE" = "RC_testing" ]; then
fi
# Update a tag.
if [ -n "$tag_version" ]; then
cd "${local_sdk_repo_dir}"
git checkout "${podspec_repo_branch}"
set +e
# If tag_version is new to the remote, remote cannot delete a non-existent
# tag, so error is allowed here.
Expand Down