Skip to content

Commit f5515ff

Browse files
committed
fix: create draft release before attaching artifacts to prevent incomplete downloads
release-please now creates a draft release, matrix builds upload all artifacts to the draft, and a new publish-release job flips it to published only after all platforms complete. This ensures /releases/latest always points to a release with all assets attached. Also removes the polling loop from update-homebrew since the release is guaranteed to have all assets by the time that job runs. https://claude.ai/code/session_01JFUTfGHH9TLrwHE1Z6spVJ Signed-off-by: Claude <noreply@anthropic.com>
1 parent 005ab3e commit f5515ff

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
pull-requests: write
2424
outputs:
2525
release_created: ${{ steps.release.outputs.release_created }}
26+
release_id: ${{ steps.release.outputs.id }}
2627
tag_name: ${{ steps.release.outputs.tag_name }}
2728
version: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
2829
steps:
@@ -141,43 +142,42 @@ jobs:
141142
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
142143
with:
143144
projectPath: apps/desktop
144-
# Use tagName to find and upload to the existing release created by release-please
145-
tagName: ${{ needs.release-please.outputs.tag_name }}
146-
releaseName: 'McpMux v${{ needs.release-please.outputs.version }}'
147-
releaseBody: '' # Release notes already created by release-please
148-
releaseDraft: false
149-
prerelease: false
145+
# Upload to the existing draft release created by release-please
146+
releaseId: ${{ needs.release-please.outputs.release_id }}
150147
updaterJsonKeepUniversal: true
151148

149+
# ─────────────────────────────────────────────────────────────
150+
# Publish Release: Flip draft → published after all artifacts
151+
# are attached, so /releases/latest always has all assets
152+
# ─────────────────────────────────────────────────────────────
153+
publish-release:
154+
needs: [release-please, build-release]
155+
if: needs.release-please.outputs.release_created == 'true'
156+
runs-on: ubuntu-latest
157+
permissions:
158+
contents: write
159+
steps:
160+
- name: Publish release
161+
uses: actions/github-script@v7
162+
with:
163+
script: |
164+
await github.rest.repos.updateRelease({
165+
owner: context.repo.owner,
166+
repo: context.repo.repo,
167+
release_id: ${{ needs.release-please.outputs.release_id }},
168+
draft: false,
169+
});
170+
152171
# ─────────────────────────────────────────────────────────────
153172
# Update Homebrew Tap: Push new version to homebrew-mcpmux
154173
# ─────────────────────────────────────────────────────────────
155174
update-homebrew:
156-
needs: [release-please, build-release]
175+
needs: [release-please, publish-release]
157176
if: needs.release-please.outputs.release_created == 'true'
158177
runs-on: ubuntu-latest
159178
permissions:
160179
contents: read
161180
steps:
162-
- name: Wait for release assets
163-
env:
164-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
165-
run: |
166-
VERSION="${{ needs.release-please.outputs.version }}"
167-
TAG="${{ needs.release-please.outputs.tag_name }}"
168-
echo "Checking release assets for $TAG..."
169-
170-
# Wait up to 5 minutes for macOS DMGs to appear
171-
for i in $(seq 1 30); do
172-
ASSETS=$(gh api repos/${{ github.repository }}/releases/tags/$TAG --jq '.assets[].name' 2>/dev/null || echo "")
173-
if echo "$ASSETS" | grep -q "aarch64.dmg" && echo "$ASSETS" | grep -q "x64.dmg"; then
174-
echo "Both macOS DMGs found"
175-
break
176-
fi
177-
echo "Waiting for macOS DMGs... (attempt $i/30)"
178-
sleep 10
179-
done
180-
181181
- name: Compute SHA256 and update cask
182182
env:
183183
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

release-please-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"changelog-path": "CHANGELOG.md",
88
"bump-minor-pre-major": true,
99
"bump-patch-for-minor-pre-major": true,
10-
"draft": false,
10+
"draft": true,
1111
"prerelease": false,
1212
"include-component-in-tag": false,
1313
"extra-files": [

0 commit comments

Comments
 (0)