From 9fe366b524e37e6ebded25485ede606d1ed0c8dc Mon Sep 17 00:00:00 2001 From: Anna Levenberg Date: Tue, 7 Nov 2023 10:32:52 -0500 Subject: [PATCH] reset renovate.sh and make changes to update --- .github/workflows/update-googleapis-sha.yml | 68 ++++++++++++++++++--- external/googleapis/renovate.sh | 11 ++++ 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-googleapis-sha.yml b/.github/workflows/update-googleapis-sha.yml index a6e2775b164b0..c07f32a99ea34 100644 --- a/.github/workflows/update-googleapis-sha.yml +++ b/.github/workflows/update-googleapis-sha.yml @@ -23,39 +23,93 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Get current date + - name: Store the current date as an environment variable run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: 'Authenticate to GCP' uses: google-github-actions/auth@v1 + # We can't use WIF since one of the steps needs access to create a storage project. with: create_credentials_file: true - credentials_json: ${{ secrets.BUILD_CACHE_KEY }} + credentials_json: ${{ secrets.GHA_STORAGE_SERVICE_ACCOUNT_CREDENTIALS_JSON }} - name: 'Set up Cloud SDK' uses: google-github-actions/setup-gcloud@v1 with: version: '>= 390.0.0' - - name: Get SHA for google apis + - name: Get latest commit from google apis run: | echo "COMMIT=$(curl -fsSL -H 'Accept: application/vnd.github.VERSION.sha' 'https://api.github.com/repos/${{ env.REPO }}/commits/${{ env.BRANCH}}')" >> $GITHUB_ENV - - name: Get SHA for google apis + - name: Get the SHA for google apis and store the archieve in our storage bucket run: | DOWNLOAD="$(mktemp)" curl -fsSL "https://github.com/${{ env.REPO }}/archive/${{ env.COMMIT }}.tar.gz" -o "${DOWNLOAD}" gsutil -q cp "${DOWNLOAD}" "gs://cloud-cpp-community-archive/com_google_googleapis/${{ env.COMMIT }}.tar.gz" echo 'SHA256=$(sha256sum "${DOWNLOAD}" | sed "s/ .*//")' >> $GITHUB_ENV rm -rf ${DOWNLOAD} - - name: Run `renovate.sh` script - run: TERM=xterm ./external/googleapis/renovate.sh + - name: Updating Bazel dependencies + run: | + sed -i -f - bazel/google_cloud_cpp_deps.bzl < This PR is auto-generated by diff --git a/external/googleapis/renovate.sh b/external/googleapis/renovate.sh index ab1b5e24ce00d..cf32ea2086b55 100755 --- a/external/googleapis/renovate.sh +++ b/external/googleapis/renovate.sh @@ -24,6 +24,17 @@ function banner() { SEPARATOR=Y } +banner "Determining googleapis HEAD commit and tarball checksum" +REPO="googleapis/googleapis" +BRANCH="master" +COMMIT=$(curl -fsSL -H "Accept: application/vnd.github.VERSION.sha" \ + "https://api.github.com/repos/${REPO}/commits/${BRANCH}") +DOWNLOAD="$(mktemp)" +curl -fsSL "https://github.com/${REPO}/archive/${COMMIT}.tar.gz" -o "${DOWNLOAD}" +gsutil -q cp "${DOWNLOAD}" "gs://cloud-cpp-community-archive/com_google_googleapis/${COMMIT}.tar.gz" +SHA256=$(sha256sum "${DOWNLOAD}" | sed "s/ .*//") +rm -f "${DOWNLOAD}" + banner "Updating Bazel/CMake dependencies" sed -i -f - bazel/google_cloud_cpp_deps.bzl <