Add draft release job to build-desktop-platforms workflow#474
Add draft release job to build-desktop-platforms workflow#474rainxchzed merged 2 commits intomainfrom
Conversation
Automates the assembly and upload of desktop installers to GitHub Releases. The new `release` job triggers after platform build completion, resolving the version from `gradle/libs.versions.toml`. It handles filename collisions by suffixing macOS binaries with architecture types (`-x64`, `-arm64`) and Linux compatibility builds with `-debian12`. The job uses `gh release create` (or `upload --clobber` if the tag exists) to manage a draft release containing the full suite of installers (EXE, MSI, DMG, PKG, DEB, RPM, AppImage, and Arch).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Actions Workflow
participant Artifacts as Actions Artifacts Storage
participant Repo as Repository (gradle/libs.versions.toml)
participant GH as GitHub Releases (gh CLI / API)
Workflow->>Repo: read gradle/libs.versions.toml (derive tag)
Workflow->>Artifacts: download artifacts from build jobs
Workflow->>Workflow: stage & rename installers into release-files/
Workflow->>Workflow: validate completeness per platform/variant groups
alt all expected artifacts present
Workflow->>GH: check for existing release tag (is draft?)
GH-->>Workflow: draft exists / not exists / published
Workflow->>GH: create or update draft release, upload assets (clobber if draft)
else missing artifacts
Workflow->>Workflow: abort with error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 5/8 reviews remaining, refill in 15 minutes and 15 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/build-desktop-platforms.yml:
- Around line 509-527: The current step uses gh release view "$TAG" only to
check existence and then blindly runs gh release upload "$TAG" --clobber; change
it to first query the release draft flag (e.g., use gh release view "$TAG"
--json draft -q '.draft' or equivalent) and only call gh release upload when
that flag is true; if the release exists but draft is false, do not upload (echo
a protective message and exit or fail the job), leaving published releases
untouched.
- Around line 445-507: The staging script currently silently skips missing
artifacts in stage() and the various loops (windows-installers,
macos-installers-x64, macos-installers-arm64, linux-installers-modern,
linux-installers-debian12-compat, linux-appimage, linux-arch), which can produce
incomplete releases; add a completeness guard after all staging that checks for
expected artifacts and exits non‑zero if any required pattern had no matches.
Implement by tracking counts (or boolean flags) per group while iterating (e.g.,
increment counters inside the existing loops or set flags inside stage()), then
after "Final staged files:" verify each counter/flag > 0 (or compare staged file
count against an expected minimum) and call echo + exit 1 with a clear message
listing missing groups if any are zero so the job fails fast before the gh
release step.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0b68ee79-5644-4879-850d-46750a94ef0d
📒 Files selected for processing (1)
.github/workflows/build-desktop-platforms.yml
The staging script in `build-desktop-platforms.yml` now tracks counts for each platform group (Windows, macOS x64/arm64, and five Linux variants). A new completeness guard fails the build if any group produces zero artifacts, preventing silent regressions where a specific installer type (like AppImage or macOS-arm64) is missing from the final release. The release upload step is also hardened to check the `isDraft` status of an existing tag via the GitHub CLI. It will only `--clobber` assets if the release is still a draft; if the release is already published, the workflow exits with an error to prevent accidental overwriting of stable artifacts. This forces a version bump in `gradle/libs.versions.toml` to roll a new release tag.
Automates the assembly and upload of desktop installers to GitHub Releases. The new
releasejob triggers after platform build completion, resolving the version fromgradle/libs.versions.toml. It handles filename collisions by suffixing macOS binaries with architecture types (-x64,-arm64) and Linux compatibility builds with-debian12. The job usesgh release create(orupload --clobberif the tag exists) to manage a draft release containing the full suite of installers (EXE, MSI, DMG, PKG, DEB, RPM, AppImage, and Arch).Summary by CodeRabbit