Skip to content

Commit 69f5b82

Browse files
committed
Add dry run mode to release-publish workflow
Defaults to dry_run=true. In dry run mode, artifacts are downloaded and checksums verified, but nothing is published. All publish jobs (GitHub release, Docker, downstream notifications) are skipped. Co-authored-by: Isaac
1 parent 79b033b commit 69f5b82

File tree

1 file changed

+58
-12
lines changed

1 file changed

+58
-12
lines changed

.github/workflows/release-publish.yml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ on:
1111
description: 'Version tag to release (e.g. v0.296.0)'
1212
required: true
1313
type: string
14+
dry_run:
15+
description: 'Dry run: download and verify artifacts without publishing'
16+
required: false
17+
type: boolean
18+
default: true
19+
20+
env:
21+
DRY_RUN: ${{ inputs.dry_run && 'true' || 'false' }}
1422

1523
jobs:
16-
create-github-release:
24+
# Always runs. Downloads artifacts from the build run and verifies them.
25+
# In non-dry-run mode, also creates the GitHub release.
26+
prepare-release:
1727
runs-on:
1828
group: databricks-deco-testing-runner-group
1929
labels: ubuntu-latest-deco
@@ -30,10 +40,31 @@ jobs:
3040
run-id: ${{ inputs.build_run_id }}
3141
github-token: ${{ secrets.GITHUB_TOKEN }}
3242

33-
- name: List artifacts
34-
run: ls -lR dist/
43+
- name: Download linux binaries
44+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
45+
with:
46+
name: release-binaries-linux
47+
path: release-binaries
48+
run-id: ${{ inputs.build_run_id }}
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: List downloaded artifacts
52+
run: |
53+
echo "=== Archives ==="
54+
ls -lR dist/
55+
echo ""
56+
echo "=== Linux binaries ==="
57+
ls -lR release-binaries/
58+
59+
- name: Verify checksums
60+
run: |
61+
echo "Verifying SHA256 checksums..."
62+
cd dist
63+
checksums_file=$(ls *SHA256SUMS* | head -1)
64+
sha256sum -c "$checksums_file"
3565
3666
- name: Create GitHub release
67+
if: env.DRY_RUN == 'false'
3768
run: |
3869
gh release create "${{ inputs.tag }}" \
3970
--repo "${{ github.repository }}" \
@@ -45,8 +76,21 @@ jobs:
4576
env:
4677
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4778

79+
- name: Dry run summary
80+
if: env.DRY_RUN == 'true'
81+
run: |
82+
echo "::notice::Dry run complete. Artifacts downloaded and verified successfully."
83+
echo "::notice::To publish, re-run this workflow with dry_run=false."
84+
echo ""
85+
echo "Archives that would be published:"
86+
ls dist/*.zip dist/*.tar.gz dist/*SHA256SUMS*
87+
echo ""
88+
echo "Linux binaries that would be used for Docker images:"
89+
find release-binaries -name databricks -type f
90+
4891
docker:
49-
needs: create-github-release
92+
if: ${{ !inputs.dry_run }}
93+
needs: prepare-release
5094
runs-on:
5195
group: databricks-deco-testing-runner-group
5296
labels: ubuntu-latest-deco
@@ -68,9 +112,6 @@ jobs:
68112
run-id: ${{ inputs.build_run_id }}
69113
github-token: ${{ secrets.GITHUB_TOKEN }}
70114

71-
- name: List downloaded binaries
72-
run: ls -lR release-binaries/
73-
74115
- name: Login to GHCR
75116
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
76117
with:
@@ -136,7 +177,8 @@ jobs:
136177
docker manifest push "ghcr.io/databricks/cli:latest"
137178
138179
create-setup-cli-release-pr:
139-
needs: create-github-release
180+
if: ${{ !inputs.dry_run }}
181+
needs: prepare-release
140182
runs-on:
141183
group: databricks-deco-testing-runner-group
142184
labels: ubuntu-latest-deco
@@ -164,7 +206,8 @@ jobs:
164206
});
165207
166208
create-homebrew-tap-release-pr:
167-
needs: create-github-release
209+
if: ${{ !inputs.dry_run }}
210+
needs: prepare-release
168211
runs-on:
169212
group: databricks-deco-testing-runner-group
170213
labels: ubuntu-latest-deco
@@ -213,7 +256,8 @@ jobs:
213256
});
214257
215258
create-vscode-extension-update-pr:
216-
needs: create-github-release
259+
if: ${{ !inputs.dry_run }}
260+
needs: prepare-release
217261
runs-on:
218262
group: databricks-deco-testing-runner-group
219263
labels: ubuntu-latest-deco
@@ -241,7 +285,8 @@ jobs:
241285
});
242286
243287
pypi-publish:
244-
needs: create-github-release
288+
if: ${{ !inputs.dry_run }}
289+
needs: prepare-release
245290
runs-on:
246291
group: databricks-deco-testing-runner-group
247292
labels: ubuntu-latest-deco
@@ -271,7 +316,8 @@ jobs:
271316
packages-dir: python/dist
272317

273318
publish-to-winget-pkgs:
274-
needs: create-github-release
319+
if: ${{ !inputs.dry_run }}
320+
needs: prepare-release
275321
runs-on:
276322
group: databricks-deco-testing-runner-group
277323
labels: ubuntu-latest-deco

0 commit comments

Comments
 (0)