@@ -280,27 +280,25 @@ steps:
280280 rm ${gradle_bin}
281281 sed -i s%services.gradle.org/distributions%storage.googleapis.com/${gcs_loc}% \
282282 gradle/wrapper/gradle-wrapper.properties
283- # Check out the release repo .
283+ # Conditionally trigger the appropriate build based on the tag format .
284284- name : ' gcr.io/cloud-builders/gcloud'
285- args : ['source', 'repos', 'clone', 'nomulus-release']
286- # Tag and check in the release repo.
287- - name : ' gcr.io/cloud-builders/git'
288- entrypoint : /bin/bash
285+ entrypoint : ' bash'
289286 args :
290287 - -c
291288 - |
292289 set -e
293- rm -rf gcompute-tools
294- cp -rf nomulus-release/.git .
295- rm -rf nomulus-release
296- git config --global user.name "Cloud Build"
297- git config --global user.email \
298- $(gcloud auth list --format='get(account)' --filter=active)
299- git add .
300- git commit -m "Release commit for tag ${TAG_NAME}"
301- git push -o nokeycheck origin master
302- git tag ${TAG_NAME}
303- git push -o nokeycheck origin ${TAG_NAME}
290+ # Check for a nomulus release tag (e.g., "v1.2.3")
291+ if [[ "${TAG_NAME}" =~ ^nomulus-20\d{2}[0-1]\d[0-3]\d-RC\d{2}$ ]]; then
292+ echo "Tag format matches a nomulus release. Triggering nomulus build..."
293+ gcloud builds submit . --config=release/cloudbuild-nomulus.yaml --substitutions=TAG_NAME=$TAG_NAME
294+ # Check for a proxy release tag (e.g., "proxy-v1.2.3")
295+ elif [[ "${TAG_NAME}" =~ ^proxy-20\d{2}[0-1]\d[0-3]\d-RC\d{2}$ ]]; then
296+ echo "Tag format matches a proxy release. Triggering proxy build..."
297+ gcloud builds submit . --config=release/cloudbuild-proxy.yaml --substitutions=TAG_NAME=$TAG_NAME
298+ else
299+ echo "Tag format '$TAG_NAME' does not match a known release type. Exiting."
300+ exit 1
301+ fi
304302timeout : 3600s
305303options :
306304 machineType : ' E2_HIGHCPU_32'
0 commit comments