Skip to content

Commit dfa2980

Browse files
committed
Use single release artifact; extract linux binaries from tar.gz for Docker
Remove the separate release-binaries-linux artifact. The publish workflow now extracts linux binaries from the tar.gz archives when building Docker images. Co-authored-by: Isaac
1 parent 33a15e3 commit dfa2980

3 files changed

Lines changed: 16 additions & 43 deletions

File tree

.github/workflows/RELEASE-DESIGN.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,10 @@ Steps:
4040
- Builds linux/darwin/windows for amd64/arm64
4141
- Signs Windows binaries via jsign post-hook
4242
9. Verify Windows binary signatures
43-
10. Upload `dist/` contents as GitHub Actions artifacts:
44-
- `release-archives`: `*.zip`, `*.tar.gz`, `*SHA256SUMS*`
45-
- `release-binaries-linux`: `dist/unix_linux_*/databricks`
46-
- `release-binaries-darwin`: `dist/unix_darwin_*/databricks`
47-
- `release-binaries-windows`: `dist/windows_windows_*/databricks.exe`
43+
10. Upload `dist/` contents as a single GitHub Actions artifact:
44+
- `release-artifacts`: `*.zip`, `*.tar.gz`, `*SHA256SUMS*`
4845

49-
The linux binaries are uploaded separately because they're needed to build Docker images in the publish step. GoReleaser does not include raw binaries in archives, so we need them as a separate artifact.
46+
Docker images are built by extracting linux binaries from the `tar.gz` archives.
5047

5148
### `release-publish.yml`
5249

@@ -74,7 +71,7 @@ Build and push multi-arch Docker images to GHCR.
7471

7572
Steps:
7673
1. Checkout (for Dockerfile and docker/ files)
77-
2. Download `release-binaries-linux` artifact from the build run
74+
2. Download `release-artifacts` and extract linux binaries from tar.gz archives
7875
3. Login to GHCR
7976
4. Setup QEMU (for cross-platform builds)
8077
5. Setup Docker (pinned version for buildx compatibility)

.github/workflows/release-build.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,15 @@ jobs:
9595
echo
9696
done
9797
98-
- name: Upload archives
98+
- name: Upload artifacts
9999
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
100100
with:
101-
name: release-archives
101+
name: release-artifacts
102102
path: |
103103
dist/*.zip
104104
dist/*.tar.gz
105105
dist/*SHA256SUMS*
106106
107-
# Upload raw linux binaries separately; needed to build Docker images in the publish workflow.
108-
- name: Upload linux binaries
109-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
110-
with:
111-
name: release-binaries-linux
112-
path: dist/unix_linux_*/databricks
113-
114107
# For snapshot builds on main: update the snapshot tag and release.
115108
- name: Update snapshot tag
116109
if: github.ref == 'refs/heads/main'

.github/workflows/release-publish.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,16 @@ jobs:
3939
contents: write
4040

4141
steps:
42-
- name: Download release archives
42+
- name: Download release artifacts
4343
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4444
with:
45-
name: release-archives
45+
name: release-artifacts
4646
path: dist
4747
run-id: ${{ inputs.build_run_id }}
4848
github-token: ${{ secrets.GITHUB_TOKEN }}
4949

50-
- name: Download linux binaries
51-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
52-
with:
53-
name: release-binaries-linux
54-
path: release-binaries
55-
run-id: ${{ inputs.build_run_id }}
56-
github-token: ${{ secrets.GITHUB_TOKEN }}
57-
5850
- name: List downloaded artifacts
59-
run: |
60-
echo "=== Archives ==="
61-
ls -lR dist/
62-
echo ""
63-
echo "=== Linux binaries ==="
64-
ls -lR release-binaries/
51+
run: ls -lR dist/
6552

6653
- name: Verify checksums
6754
run: |
@@ -91,9 +78,6 @@ jobs:
9178
echo ""
9279
echo "Archives that would be published:"
9380
ls dist/*.zip dist/*.tar.gz dist/*SHA256SUMS*
94-
echo ""
95-
echo "Linux binaries that would be used for Docker images:"
96-
find release-binaries -name databricks -type f
9781
9882
docker:
9983
if: ${{ !inputs.dry_run }}
@@ -111,11 +95,11 @@ jobs:
11195
with:
11296
ref: ${{ inputs.tag }}
11397

114-
- name: Download linux binaries
98+
- name: Download release artifacts
11599
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
116100
with:
117-
name: release-binaries-linux
118-
path: release-binaries
101+
name: release-artifacts
102+
path: dist
119103
run-id: ${{ inputs.build_run_id }}
120104
github-token: ${{ secrets.GITHUB_TOKEN }}
121105

@@ -153,9 +137,8 @@ jobs:
153137
mkdir -p "$tmp/docker"
154138
cp docker/config.tfrc docker/setup.sh "$tmp/docker/"
155139
156-
# Find and copy the binary for this architecture.
157-
binary=$(find release-binaries -path "*linux_${arch}*/databricks" | head -1)
158-
cp "$binary" "$tmp/databricks"
140+
# Extract the linux binary from the tar.gz archive.
141+
tar -xzf "dist/databricks_cli_${VERSION}_linux_${arch}.tar.gz" -C "$tmp" databricks
159142
chmod +x "$tmp/databricks"
160143
161144
docker buildx build \
@@ -220,10 +203,10 @@ jobs:
220203
labels: ubuntu-latest-deco
221204

222205
steps:
223-
- name: Download release archives
206+
- name: Download release artifacts
224207
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
225208
with:
226-
name: release-archives
209+
name: release-artifacts
227210
path: dist
228211
run-id: ${{ inputs.build_run_id }}
229212
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)