@@ -119,6 +119,7 @@ jobs:
119119 uses : ./.github/actions/deploy-docker-image
120120 with :
121121 arch : amd64
122+ deploy-channel : ${{ inputs.deploy-channel }}
122123 deploy-docker-image-arm64 :
123124 if : inputs.deploy-channel != ''
124125 needs : [update-bazel-cache-and-deploy-debian-package-arm64]
@@ -143,6 +144,7 @@ jobs:
143144 uses : ./.github/actions/deploy-docker-image
144145 with :
145146 arch : arm64
147+ deploy-channel : ${{ inputs.deploy-channel }}
146148 deploy-docker-manifest :
147149 if : inputs.deploy-channel != ''
148150 needs : [deploy-docker-image-amd64, deploy-docker-image-arm64]
@@ -163,14 +165,27 @@ jobs:
163165 password : ' ${{ secrets.artifact-registry-uploader-json-creds }}'
164166 - name : Deploy manifests
165167 run : |
166- # TODO(b/440196950): Setup condition on this step when we build
167- # stable/unstable versions here too.
168-
169- # Stable/Unstable version tag : X.Y.Z
170- # Nightly version tag : gitYYYYMMDD-<Github SHA 8 digit>
171- DATE=$(date -u +'%Y%m%d')
172- SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
173- TAG="git${DATE}-${SHORT_SHA}"
168+ case "${{ inputs.deploy-channel }}" in
169+ stable)
170+ # Stable version tag : X.Y.Z
171+ SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+.[0-9]+'
172+ TAG="${SEMVER}"
173+ ;;
174+ unstable)
175+ # Unstable version tag : X.Y-<Github SHA 8 digit>
176+ SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+'
177+ SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
178+ TAG="${SEMVER}-${SHORT_SHA}"
179+ ;;
180+ nightly)
181+ # Nightly version tag : gitYYYYMMDDHHMM-<Github SHA 8 digit>
182+ DATE=$(date -u +'%Y%m%d%H%M')
183+ SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
184+ TAG="git${DATE}-${SHORT_SHA}"
185+ *)
186+ exit 1
187+ ;;
188+ esac
174189 IMAGE=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration
175190
176191 for MANIFEST_TAG in ${TAG} ${{ inputs.deploy-channel }}; do
0 commit comments