From ff4c326ebe3c2a11edfdc8317634949ef6b647a5 Mon Sep 17 00:00:00 2001 From: Juan Celhay Date: Tue, 21 Oct 2025 14:52:42 -0400 Subject: [PATCH] Delete step to push to release repo, trigger next release steps based on tag format (#2833) * Change release cb file * Add brackets around tag variable * Redo tag matching * Have tag matcher like the one in cb dev --- release/cloudbuild-release.yaml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/release/cloudbuild-release.yaml b/release/cloudbuild-release.yaml index e3eef1e04..057462728 100644 --- a/release/cloudbuild-release.yaml +++ b/release/cloudbuild-release.yaml @@ -280,27 +280,25 @@ steps: rm ${gradle_bin} sed -i s%services.gradle.org/distributions%storage.googleapis.com/${gcs_loc}% \ gradle/wrapper/gradle-wrapper.properties -# Check out the release repo. +# Conditionally trigger the appropriate build based on the tag format. - name: 'gcr.io/cloud-builders/gcloud' - args: ['source', 'repos', 'clone', 'nomulus-release'] -# Tag and check in the release repo. -- name: 'gcr.io/cloud-builders/git' - entrypoint: /bin/bash + entrypoint: 'bash' args: - -c - | set -e - rm -rf gcompute-tools - cp -rf nomulus-release/.git . - rm -rf nomulus-release - git config --global user.name "Cloud Build" - git config --global user.email \ - $(gcloud auth list --format='get(account)' --filter=active) - git add . - git commit -m "Release commit for tag ${TAG_NAME}" - git push -o nokeycheck origin master - git tag ${TAG_NAME} - git push -o nokeycheck origin ${TAG_NAME} + # Check for a nomulus release tag (e.g., "v1.2.3") + if [[ "${TAG_NAME}" =~ ^nomulus-20\d{2}[0-1]\d[0-3]\d-RC\d{2}$ ]]; then + echo "Tag format matches a nomulus release. Triggering nomulus build..." + gcloud builds submit . --config=release/cloudbuild-nomulus.yaml --substitutions=TAG_NAME=$TAG_NAME + # Check for a proxy release tag (e.g., "proxy-v1.2.3") + elif [[ "${TAG_NAME}" =~ ^proxy-20\d{2}[0-1]\d[0-3]\d-RC\d{2}$ ]]; then + echo "Tag format matches a proxy release. Triggering proxy build..." + gcloud builds submit . --config=release/cloudbuild-proxy.yaml --substitutions=TAG_NAME=$TAG_NAME + else + echo "Tag format '$TAG_NAME' does not match a known release type. Exiting." + exit 1 + fi timeout: 3600s options: machineType: 'E2_HIGHCPU_32'