Skip to content

Commit efeb011

Browse files
authored
Replace release workflow with release-prs (#4909)
## Summary - Remove the `release` workflow which combined building, signing, publishing, and downstream PR creation - Add `release-prs` workflow (`workflow_dispatch`) that handles the downstream PR/publish jobs: - **setup-cli**: dispatches `release-pr.yml` in `databricks/setup-cli` - **homebrew-tap**: downloads checksums from the GitHub release, dispatches `release-pr.yml` in `databricks/homebrew-tap` - **vscode-extension**: dispatches `update-cli-version.yml` in `databricks/databricks-vscode` - **winget**: fetches Windows zip URLs from the release, publishes via komac - Each job is individually toggleable (default: off) with a dry-run mode (default: on) - Build and signing responsibilities were already moved to `release-build` in #4900 ## Test plan - [x] Verified checksum extraction logic against the v0.295.0 release SHA256SUMS file - [x] Verified winget URL extraction against the v0.295.0 release assets - [ ] Run `release-prs` in dry-run mode after merge to validate end-to-end This pull request was AI-assisted by Isaac.
1 parent 48a4c09 commit efeb011

2 files changed

Lines changed: 242 additions & 390 deletions

File tree

.github/workflows/release-prs.yml

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
name: release-prs
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Release tag (e.g. v0.295.0)"
8+
required: true
9+
type: string
10+
dry_run:
11+
description: "Dry run (log what would happen, skip actual dispatches)"
12+
required: false
13+
type: boolean
14+
default: true
15+
setup_cli:
16+
description: "Create setup-cli release PR"
17+
required: false
18+
type: boolean
19+
default: false
20+
homebrew_tap:
21+
description: "Create homebrew-tap release PR"
22+
required: false
23+
type: boolean
24+
default: false
25+
vscode_extension:
26+
description: "Create VS Code extension update PR"
27+
required: false
28+
type: boolean
29+
default: false
30+
winget:
31+
description: "Publish to winget-pkgs"
32+
required: false
33+
type: boolean
34+
default: false
35+
36+
jobs:
37+
create-setup-cli-release-pr:
38+
if: ${{ inputs.setup_cli }}
39+
runs-on:
40+
group: databricks-deco-testing-runner-group
41+
labels: ubuntu-latest-deco
42+
43+
steps:
44+
- name: Derive version from tag
45+
run: |
46+
VERSION="${{ inputs.tag }}"
47+
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
48+
49+
- name: Log dispatch
50+
run: |
51+
echo "Repository: databricks/setup-cli"
52+
echo "Workflow: release-pr.yml"
53+
echo "Version: $VERSION"
54+
echo "Dry run: ${{ inputs.dry_run }}"
55+
56+
- name: Dispatch setup-cli release PR
57+
if: ${{ !inputs.dry_run }}
58+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
59+
with:
60+
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
61+
script: |
62+
await github.rest.actions.createWorkflowDispatch({
63+
owner: 'databricks',
64+
repo: 'setup-cli',
65+
workflow_id: 'release-pr.yml',
66+
ref: 'main',
67+
inputs: {
68+
version: "${{ env.VERSION }}",
69+
}
70+
});
71+
72+
create-homebrew-tap-release-pr:
73+
if: ${{ inputs.homebrew_tap }}
74+
runs-on:
75+
group: databricks-deco-testing-runner-group
76+
labels: ubuntu-latest-deco
77+
78+
steps:
79+
- name: Derive version from tag
80+
run: |
81+
VERSION="${{ inputs.tag }}"
82+
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
83+
84+
- name: Download checksums from release
85+
run: |
86+
gh release download "${{ inputs.tag }}" \
87+
--pattern "databricks_cli_${VERSION}_SHA256SUMS" \
88+
--dir . \
89+
--repo "${{ github.repository }}"
90+
echo "SHA256SUMS contents:"
91+
cat "databricks_cli_${VERSION}_SHA256SUMS"
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
95+
- name: Extract per-platform checksums
96+
run: |
97+
extract_sha() {
98+
grep "databricks_cli_${VERSION}_${1}.zip" "databricks_cli_${VERSION}_SHA256SUMS" | awk '{print $1}'
99+
}
100+
{
101+
echo "DARWIN_AMD64_SHA=$(extract_sha darwin_amd64)"
102+
echo "DARWIN_ARM64_SHA=$(extract_sha darwin_arm64)"
103+
echo "LINUX_AMD64_SHA=$(extract_sha linux_amd64)"
104+
echo "LINUX_ARM64_SHA=$(extract_sha linux_arm64)"
105+
} >> $GITHUB_ENV
106+
107+
- name: Log dispatch
108+
run: |
109+
echo "Repository: databricks/homebrew-tap"
110+
echo "Workflow: release-pr.yml"
111+
echo "Version: $VERSION"
112+
echo "darwin_amd64_sha: $DARWIN_AMD64_SHA"
113+
echo "darwin_arm64_sha: $DARWIN_ARM64_SHA"
114+
echo "linux_amd64_sha: $LINUX_AMD64_SHA"
115+
echo "linux_arm64_sha: $LINUX_ARM64_SHA"
116+
echo "Dry run: ${{ inputs.dry_run }}"
117+
118+
- name: Dispatch homebrew-tap release PR
119+
if: ${{ !inputs.dry_run }}
120+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
121+
with:
122+
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
123+
script: |
124+
await github.rest.actions.createWorkflowDispatch({
125+
owner: 'databricks',
126+
repo: 'homebrew-tap',
127+
workflow_id: 'release-pr.yml',
128+
ref: 'main',
129+
inputs: {
130+
version: "${{ env.VERSION }}",
131+
darwin_amd64_sha: "${{ env.DARWIN_AMD64_SHA }}",
132+
darwin_arm64_sha: "${{ env.DARWIN_ARM64_SHA }}",
133+
linux_amd64_sha: "${{ env.LINUX_AMD64_SHA }}",
134+
linux_arm64_sha: "${{ env.LINUX_ARM64_SHA }}",
135+
}
136+
});
137+
138+
create-vscode-extension-update-pr:
139+
if: ${{ inputs.vscode_extension }}
140+
runs-on:
141+
group: databricks-deco-testing-runner-group
142+
labels: ubuntu-latest-deco
143+
144+
steps:
145+
- name: Derive version from tag
146+
run: |
147+
VERSION="${{ inputs.tag }}"
148+
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
149+
150+
- name: Log dispatch
151+
run: |
152+
echo "Repository: databricks/databricks-vscode"
153+
echo "Workflow: update-cli-version.yml"
154+
echo "Version: $VERSION"
155+
echo "Dry run: ${{ inputs.dry_run }}"
156+
157+
- name: Dispatch VS Code extension update PR
158+
if: ${{ !inputs.dry_run }}
159+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
160+
with:
161+
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
162+
script: |
163+
await github.rest.actions.createWorkflowDispatch({
164+
owner: 'databricks',
165+
repo: 'databricks-vscode',
166+
workflow_id: 'update-cli-version.yml',
167+
ref: 'main',
168+
inputs: {
169+
version: "${{ env.VERSION }}",
170+
}
171+
});
172+
173+
publish-to-winget-pkgs:
174+
if: ${{ inputs.winget }}
175+
runs-on:
176+
group: databricks-deco-testing-runner-group
177+
labels: ubuntu-latest-deco
178+
179+
environment: release
180+
181+
steps:
182+
- name: Derive version from tag
183+
run: |
184+
VERSION="${{ inputs.tag }}"
185+
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
186+
187+
- name: Get URLs of signed Windows binaries
188+
id: get_windows_urls
189+
run: |
190+
urls=$(
191+
gh api "repos/${{ github.repository }}/releases/tags/${{ inputs.tag }}" | \
192+
jq -r .assets[].browser_download_url | \
193+
grep -E '_windows_.*\.zip$' | \
194+
tr '\n' ' '
195+
)
196+
if [ -z "$urls" ]; then
197+
echo "No signed Windows binaries found" >&2
198+
exit 1
199+
fi
200+
echo "urls=$urls" >> "$GITHUB_OUTPUT"
201+
env:
202+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203+
204+
- name: Log publish
205+
run: |
206+
echo "Package: Databricks.DatabricksCLI"
207+
echo "Version: $VERSION"
208+
echo "URLs: ${{ steps.get_windows_urls.outputs.urls }}"
209+
echo "Dry run: ${{ inputs.dry_run }}"
210+
211+
# When updating the version of komac, make sure to update the checksum in the next step.
212+
# Find both at https://github.com/russellbanks/Komac/releases.
213+
- name: Download komac binary
214+
if: ${{ !inputs.dry_run }}
215+
run: |
216+
curl -s -L -o $RUNNER_TEMP/komac-2.9.0-x86_64-unknown-linux-gnu.tar.gz https://github.com/russellbanks/Komac/releases/download/v2.9.0/komac-2.9.0-x86_64-unknown-linux-gnu.tar.gz
217+
218+
- name: Verify komac binary
219+
if: ${{ !inputs.dry_run }}
220+
run: |
221+
echo "d07a12831ad5418fee715488542a98ce3c0e591d05c850dd149fe78432be8c4c $RUNNER_TEMP/komac-2.9.0-x86_64-unknown-linux-gnu.tar.gz" | sha256sum -c -
222+
223+
- name: Untar komac binary to temporary path
224+
if: ${{ !inputs.dry_run }}
225+
run: |
226+
mkdir -p $RUNNER_TEMP/komac
227+
tar -xzf $RUNNER_TEMP/komac-2.9.0-x86_64-unknown-linux-gnu.tar.gz -C $RUNNER_TEMP/komac
228+
229+
- name: Add komac to PATH
230+
if: ${{ !inputs.dry_run }}
231+
run: echo "$RUNNER_TEMP/komac" >> $GITHUB_PATH
232+
233+
- name: Publish to Winget
234+
if: ${{ !inputs.dry_run }}
235+
run: |
236+
komac update Databricks.DatabricksCLI \
237+
--version $VERSION \
238+
--submit \
239+
--urls ${{ steps.get_windows_urls.outputs.urls }}
240+
env:
241+
KOMAC_FORK_OWNER: eng-dev-ecosystem-bot
242+
GITHUB_TOKEN: ${{ secrets.ENG_DEV_ECOSYSTEM_BOT_TOKEN }}

0 commit comments

Comments
 (0)