Repository navigation
112 lines (98 loc) · 4.34 KB
/
Copy pathrelease-docker.yml
File metadata and controls
112 lines (98 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: release-docker
# Publishes a Docker image for a specific CLI release tag to ghcr.io/databricks/cli.
#
# Why this is a separate workflow (not part of release-build):
# The release pipeline was simplified in April 2026 (commit 6a0ddd896) by
# consolidating two goreleaser configs into one. Docker publishing was
# intentionally removed from goreleaser at that point ("to be handled
# separately") because goreleaser's docker_manifests step was broken by
# Docker 29.x changing how buildx pushes single-platform images (they became
# OCI manifest lists, which goreleaser could not merge). Rather than pin the
# entire release runner to Docker 28.x indefinitely, Docker publishing was
# decoupled into this standalone workflow that uses `docker buildx imagetools`
# directly and is unaffected by the goreleaser/Docker compatibility issue.
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag to publish (e.g. v0.298.0)"
type: string
required: true
update_latest:
description: "Also update the 'latest' and 'latest-<arch>' tags"
type: boolean
default: true
jobs:
docker:
runs-on:
group: databricks-protected-runner-group-large
labels: linux-ubuntu-latest-large
permissions:
packages: write
contents: read
steps:
- name: Checkout repository at release tag
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.tag }}
- name: Set up QEMU for cross-platform builds
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Create a buildx builder with multi-platform support
run: docker buildx create --use --driver docker-container
- name: Log in to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Strip leading 'v' from tag
id: version
run: echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
env:
TAG: ${{ inputs.tag }}
- name: Download CLI release binaries
run: |
VERSION="${{ steps.version.outputs.version }}"
TAG="${{ inputs.tag }}"
for ARCH in amd64 arm64; do
curl -sfL \
"https://github.com/databricks/cli/releases/download/${TAG}/databricks_cli_${VERSION}_linux_${ARCH}.tar.gz" \
-o "/tmp/databricks_${ARCH}.tar.gz"
mkdir -p "/tmp/cli_${ARCH}"
tar -xzf "/tmp/databricks_${ARCH}.tar.gz" -C "/tmp/cli_${ARCH}" databricks
done
- name: Build and push amd64 image
run: |
cp /tmp/cli_amd64/databricks ./databricks
docker buildx build \
--platform linux/amd64 \
--tag "ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-amd64" \
--push .
rm databricks
- name: Build and push arm64 image
run: |
cp /tmp/cli_arm64/databricks ./databricks
docker buildx build \
--platform linux/arm64 \
--tag "ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-arm64" \
--push .
rm databricks
- name: Create and push version-pinned multi-arch manifest
run: |
docker buildx imagetools create \
--tag "ghcr.io/databricks/cli:${{ steps.version.outputs.version }}" \
"ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-amd64" \
"ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-arm64"
- name: Update latest multi-arch manifest
if: inputs.update_latest
run: |-
docker buildx imagetools create \
--tag ghcr.io/databricks/cli:latest-amd64 \
"ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-amd64"
docker buildx imagetools create \
--tag ghcr.io/databricks/cli:latest-arm64 \
"ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-arm64"
docker buildx imagetools create \
--tag ghcr.io/databricks/cli:latest \
"ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-amd64" \
"ghcr.io/databricks/cli:${{ steps.version.outputs.version }}-arm64"