Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/actions/build-debian-packages/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ runs:
# Modify debian/changelog to build debian package with desired version
# format.
# Stable version format : X.Y.Z
# Unstable/nightly version format : X.Y.Z~gitYYYYMMDD.<Github SHA 8 digit>
DATE=$(date -u +'%Y%m%d')
# Unstable/nightly version format : X.Y.Z~gitYYYYMMDDHHMM.<Github SHA 8 digit>
DATETIME=$(date -u +'%Y%m%d%H%M')
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
SUFFIX="~git${DATE}.${SHORT_SHA}"
SUFFIX="~git${DATETIME}.${SHORT_SHA}"
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \
base/debian/changelog
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \
Expand Down
31 changes: 23 additions & 8 deletions .github/actions/deploy-docker-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,34 @@ name: 'Deploy docker image cuttlefish-orchestration'
inputs:
arch:
required: true
deploy-channel:
required: true
runs:
using: "composite"
steps:
- name: Deploy docker image into Artifact Registry
run: |
# TODO(b/440196950): Setup condition on this step when we build
# stable/unstable versions here too.

# Stable/Unstable version tag : X.Y.Z
# Nightly version tag : gitYYYYMMDD-<Github SHA 8 digit>
DATE=$(date -u +'%Y%m%d')
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
TAG="git${DATE}-${SHORT_SHA}-${{ inputs.arch }}"
case "${{ inputs.deploy-channel }}" in
stable)
# Stable version tag : X.Y.Z-<amd64|arm64>
SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+.[0-9]+'
TAG="${SEMVER}-${{ inputs.arch }}"
;;
unstable)
# Unstable version tag : X.Y-<Github SHA 8 digit>-<amd64|arm64>
SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+'
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
TAG="${SEMVER}-${SHORT_SHA}-${{ inputs.arch }}"
;;
nightly)
# Nightly version tag : gitYYYYMMDDHHMM-<Github SHA 8 digit>-<amd64|arm64>
DATE=$(date -u +'%Y%m%d%H%M')
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
TAG="git${DATE}-${SHORT_SHA}-${{ inputs.arch }}"
*)
exit 1
;;
esac
REMOTE_IMAGE_TAG=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration:${TAG}

docker tag cuttlefish-orchestration ${REMOTE_IMAGE_TAG}
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/update-cache-and-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
uses: ./.github/actions/deploy-docker-image
with:
arch: amd64
deploy-channel: ${{ inputs.deploy-channel }}
deploy-docker-image-arm64:
if: inputs.deploy-channel != ''
needs: [update-bazel-cache-and-deploy-debian-package-arm64]
Expand All @@ -143,6 +144,7 @@ jobs:
uses: ./.github/actions/deploy-docker-image
with:
arch: arm64
deploy-channel: ${{ inputs.deploy-channel }}
deploy-docker-manifest:
if: inputs.deploy-channel != ''
needs: [deploy-docker-image-amd64, deploy-docker-image-arm64]
Expand All @@ -163,14 +165,27 @@ jobs:
password: '${{ secrets.artifact-registry-uploader-json-creds }}'
- name: Deploy manifests
run: |
# TODO(b/440196950): Setup condition on this step when we build
# stable/unstable versions here too.

# Stable/Unstable version tag : X.Y.Z
# Nightly version tag : gitYYYYMMDD-<Github SHA 8 digit>
DATE=$(date -u +'%Y%m%d')
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
TAG="git${DATE}-${SHORT_SHA}"
case "${{ inputs.deploy-channel }}" in
stable)
# Stable version tag : X.Y.Z
SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+.[0-9]+'
TAG="${SEMVER}"
;;
unstable)
# Unstable version tag : X.Y-<Github SHA 8 digit>
SEMVER=$(echo ${{ github.ref_name }} | grep -oE '[0-9]+.[0-9]+'
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
TAG="${SEMVER}-${SHORT_SHA}"
;;
nightly)
# Nightly version tag : gitYYYYMMDDHHMM-<Github SHA 8 digit>
DATE=$(date -u +'%Y%m%d%H%M')
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
TAG="git${DATE}-${SHORT_SHA}"
*)
exit 1
;;
esac
IMAGE=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration

for MANIFEST_TAG in ${TAG} ${{ inputs.deploy-channel }}; do
Expand Down
Loading