diff --git a/.github/workflows/update-googleapis-sha.yml b/.github/workflows/update-googleapis-sha.yml index a6e2775b164b..c07f32a99ea3 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 ab1b5e24ce00..cf32ea2086b5 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 <