Skip to content

Add draft release job to build-desktop-platforms workflow#474

Merged
rainxchzed merged 2 commits intomainfrom
upload-workflow
Apr 30, 2026
Merged

Add draft release job to build-desktop-platforms workflow#474
rainxchzed merged 2 commits intomainfrom
upload-workflow

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented Apr 30, 2026

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).

Summary by CodeRabbit

  • Chores
    • Automates creation and updating of draft releases.
    • Collects and consolidates installer builds for Windows, macOS, and Linux into a single staged directory to avoid filename collisions.
    • Enforces completeness by ensuring expected artifacts exist for each platform/variant before release.
    • Streamlines packaging and upload steps for multi-platform releases.

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).
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0ce367b7-eae4-4f08-a323-1d5f7fca6381

📥 Commits

Reviewing files that changed from the base of the PR and between b13dbc1 and 401f5a7.

📒 Files selected for processing (1)
  • .github/workflows/build-desktop-platforms.yml

Walkthrough

Adds a release job to the build-desktop-platforms GitHub Actions workflow that derives a release tag from gradle/libs.versions.toml, downloads and stages installer artifacts (renaming to avoid filename collisions across architectures/variants), validates completeness, and creates or updates a draft GitHub release with the staged assets.

Changes

Cohort / File(s) Summary
Release Automation Job
.github/workflows/build-desktop-platforms.yml
Added a new release job that: reads app version from gradle/libs.versions.toml to compute a tag, downloads build artifacts from prior jobs, stages and renames installers into release-files/ to avoid collisions across macOS (x64/arm64) and Linux variants, enforces completeness checks per expected platform/variant groups, and creates or updates a draft GitHub release using gh release upload --clobber only for draft tags (failing if the tag is already published).

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through workflows, bright and spry,

Gathered builds beneath CI sky,
Renamed, staged, and checked the crew,
Tagged with Gradle, drafted anew,
A tiny hop — releases fly.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: adding a new draft release job to the build-desktop-platforms workflow, which is the primary objective of this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upload-workflow

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.

❤️ Share
Review rate limit: 5/8 reviews remaining, refill in 15 minutes and 15 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 181b15c and b13dbc1.

📒 Files selected for processing (1)
  • .github/workflows/build-desktop-platforms.yml

Comment thread .github/workflows/build-desktop-platforms.yml
Comment thread .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.
@rainxchzed rainxchzed merged commit df630a0 into main Apr 30, 2026
@rainxchzed rainxchzed deleted the upload-workflow branch April 30, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant