release_testing_setup.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright 2020 Google LLC
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. set -xe
  15. if [ -f "${HOME}/.cocoapods/repos" ]; then
  16. find "${HOME}/.cocoapods/repos" -type d -maxdepth 1 -exec sh -c 'pod repo remove $(basename {})' \;
  17. fi
  18. tag_version="nightly-test-${nightly_test_version}"
  19. git config --global user.email "google-oss-bot@example.com"
  20. git config --global user.name "google-oss-bot"
  21. mkdir -p /tmp/test/firebase-ios-sdk
  22. git clone -q -b "${podspec_repo_branch}" https://"${BOT_TOKEN}"@github.com/firebase/firebase-ios-sdk.git "${local_sdk_repo_dir}"
  23. cd "${local_sdk_repo_dir}"
  24. # Update a tag.
  25. set +e
  26. # If tag_version is new to the remote, remote cannot delete an unexisted tag,
  27. # so error is allowed here.
  28. git push origin --delete "${tag_version}"
  29. set -e
  30. git tag -f -a "${tag_version}" -m "release testing"
  31. git push origin "${tag_version}"
  32. # Update source and tag, e.g. ":tag => 'CocoaPods-' + s.version.to_s" to
  33. # ":tag => test"
  34. sed -i "" "s/\s*:tag.*/:tag => '${tag_version}'/" *.podspec
  35. cd "${GITHUB_WORKSPACE}/ZipBuilder"
  36. swift build
  37. # Update Pod versions.
  38. ./.build/debug/firebase-pod-updater --git-root "${local_sdk_repo_dir}" --releasing-pods "${GITHUB_WORKSPACE}/scripts/create_spec_repo/firebase_sdk.textproto"