|
| 1 | +# Release Pipeline Design |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Split the release pipeline into two independent workflows: |
| 6 | + |
| 7 | +1. **Build** — produce all release artifacts (binaries, archives, checksums, signed Windows binaries) |
| 8 | +2. **Publish** — take artifacts from a previous build and publish them (GitHub release, Docker images, downstream notifications) |
| 9 | + |
| 10 | +A manual inspection/scanning step happens between build and publish. |
| 11 | + |
| 12 | +## Workflows |
| 13 | + |
| 14 | +### `release-build.yml` |
| 15 | + |
| 16 | +Produces release artifacts without publishing anything. |
| 17 | + |
| 18 | +**Triggers:** |
| 19 | +- `push` on tags matching `v*` |
| 20 | +- `push` on branches `main`, `split-release-workflows` (replaces `release-snapshot.yml`) |
| 21 | +- `workflow_dispatch` (for testing) |
| 22 | + |
| 23 | +When triggered by a branch push (not a tag), goreleaser runs in `--snapshot` mode. |
| 24 | +This consolidates snapshot and release builds into a single workflow. |
| 25 | +The `release-snapshot.yml` workflow can be removed once this is in place. |
| 26 | + |
| 27 | +**Single job: `build`** |
| 28 | + |
| 29 | +Runs on: `ubuntu-latest-deco` (self-hosted Linux) |
| 30 | + |
| 31 | +Steps: |
| 32 | +1. Checkout (with full history and tags for goreleaser versioning) |
| 33 | +2. Setup JFrog CLI with OIDC |
| 34 | +3. Setup Go |
| 35 | +4. Download Go modules via JFrog (`jf goc` + `jf go mod download`) |
| 36 | +5. Setup Java (for jsign) |
| 37 | +6. Download and verify jsign jar |
| 38 | +7. Acquire Azure Key Vault access token |
| 39 | +8. Run GoReleaser with `--skip=publish,docker` |
| 40 | + - Builds linux/darwin/windows for amd64/arm64 |
| 41 | + - Signs Windows binaries via jsign post-hook |
| 42 | +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` |
| 48 | + |
| 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. |
| 50 | + |
| 51 | +### `release-publish.yml` |
| 52 | + |
| 53 | +Publishes artifacts from a previous build run. |
| 54 | + |
| 55 | +**Triggers:** |
| 56 | +- `workflow_dispatch` with inputs: |
| 57 | + - `build-run-id` (required): the run ID of a `release-build.yml` run |
| 58 | + - `tag` (required): the version tag to release (e.g. `v0.296.0`) |
| 59 | + |
| 60 | +**Jobs:** |
| 61 | + |
| 62 | +#### `create-github-release` |
| 63 | + |
| 64 | +Download archives and checksums from the build run and create a GitHub release. |
| 65 | + |
| 66 | +Steps: |
| 67 | +1. Download `release-archives` artifact from the specified build run |
| 68 | +2. Create GitHub release for the tag |
| 69 | +3. Upload archives and checksums to the release |
| 70 | + |
| 71 | +#### `docker` (needs: `create-github-release`) |
| 72 | + |
| 73 | +Build and push multi-arch Docker images to GHCR. |
| 74 | + |
| 75 | +Steps: |
| 76 | +1. Checkout (for Dockerfile and docker/ files) |
| 77 | +2. Download `release-binaries-linux` artifact from the build run |
| 78 | +3. Login to GHCR |
| 79 | +4. Setup QEMU (for cross-platform builds) |
| 80 | +5. Setup Docker (pinned version for buildx compatibility) |
| 81 | +6. For each arch (amd64, arm64): |
| 82 | + - Copy the binary into a temp build context alongside Dockerfile and docker/ files |
| 83 | + - Build with `docker buildx build --push` |
| 84 | +7. Create and push multi-arch manifest |
| 85 | + |
| 86 | +#### `notify-downstream` (needs: `create-github-release`) |
| 87 | + |
| 88 | +Trigger downstream repository updates. Parallel jobs for: |
| 89 | +- `setup-cli` — workflow dispatch to `databricks/setup-cli` |
| 90 | +- `homebrew-tap` — workflow dispatch to `databricks/homebrew-tap` (with checksums) |
| 91 | +- `vscode-extension` — workflow dispatch to `databricks/databricks-vscode` |
| 92 | + |
| 93 | +#### `pypi-publish` (needs: `create-github-release`) |
| 94 | + |
| 95 | +Build and publish Python wheel to PyPI. |
| 96 | + |
| 97 | +#### `publish-to-winget-pkgs` (needs: `create-github-release`) |
| 98 | + |
| 99 | +Publish to Windows Package Manager. |
| 100 | + |
| 101 | +## GoReleaser Configuration |
| 102 | + |
| 103 | +A single `.goreleaser-release.yaml` replaces both `.goreleaser-unix.yaml` and `.goreleaser-windows.yaml`. |
| 104 | + |
| 105 | +- Two build IDs: `unix` (linux + darwin) and `windows` (with jsign signing hook) |
| 106 | +- No `dockers:` or `docker_manifests:` sections (Docker is handled by the publish workflow) |
| 107 | +- No `release:` section (GitHub release is handled by the publish workflow) |
| 108 | +- No `before.hooks` (module download handled by the workflow) |
| 109 | + |
| 110 | +## Testing approach |
| 111 | + |
| 112 | +While iterating on this branch: |
| 113 | +- Both workflows use a dummy binary (`.github/release-test/main.go`) for fast builds |
| 114 | +- The build workflow has a `push` trigger for the branch |
| 115 | +- Windows signing is exercised on every build |
| 116 | +- Docker builds use the real Dockerfile |
| 117 | +- The publish workflow can be tested with `workflow_dispatch` pointing at a build run |
| 118 | + |
| 119 | +To go to production: |
| 120 | +- Remove `main:` overrides from `.goreleaser-release.yaml` (builds the real CLI) |
| 121 | +- Remove the `split-release-workflows` branch from the push trigger |
| 122 | +- Delete `.goreleaser-unix.yaml` and `.goreleaser-windows.yaml` |
| 123 | +- Replace `release.yml` with `release-build.yml` + `release-publish.yml` |
| 124 | +- Replace `release-snapshot.yml` with `release-build.yml` (already handles snapshot mode) |
| 125 | +- Delete `release-test.yml` |
| 126 | + |
| 127 | +## Artifact flow |
| 128 | + |
| 129 | +``` |
| 130 | +release-build.yml (run ID: 12345) |
| 131 | + └─ uploads artifacts ─┐ |
| 132 | + │ |
| 133 | + [manual inspection] │ |
| 134 | + │ |
| 135 | +release-publish.yml │ |
| 136 | + (input: build-run-id=12345, tag=v0.296.0) |
| 137 | + ├─ downloads artifacts ┘ |
| 138 | + ├─ creates GitHub release with archives |
| 139 | + ├─ builds + pushes Docker images from linux binaries |
| 140 | + └─ notifies downstream repos |
| 141 | +``` |
0 commit comments