Skip to content

Prepare 0.2.0 release packaging#6

Merged
xsyetopz merged 1 commit into
mainfrom
release-020-update-dmg
May 21, 2026
Merged

Prepare 0.2.0 release packaging#6
xsyetopz merged 1 commit into
mainfrom
release-020-update-dmg

Conversation

@xsyetopz
Copy link
Copy Markdown
Owner

@xsyetopz xsyetopz commented May 21, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added update checking functionality. Users can now check for new releases and open the latest version directly from the application.
  • Chores

    • Version updated to 0.2.0.
    • Release distribution format changed from ZIP to macOS DMG for improved installation experience.

Review Change Stack

@xsyetopz xsyetopz merged commit 214dfb1 into main May 21, 2026
1 check was pending
@xsyetopz xsyetopz deleted the release-020-update-dmg branch May 21, 2026 12:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ff4d1a33-db3a-42af-9607-24ad3730fb15

📥 Commits

Reviewing files that changed from the base of the PR and between 5288024 and 3918f85.

📒 Files selected for processing (15)
  • .github/workflows/release.yml
  • CHANGELOG.md
  • DriverKitExtension/Info.plist
  • Sources/OpenJoystickDriver/App/AppModel.swift
  • Sources/OpenJoystickDriver/App/UpdateChecker.swift
  • Sources/OpenJoystickDriver/CLI.swift
  • Sources/OpenJoystickDriver/Views/MenuBarPopoverView.swift
  • Sources/OpenJoystickDriverKit/Update/SemanticVersion.swift
  • Tests/OpenJoystickDriverKitTests/SemanticVersionTests.swift
  • scripts/README.md
  • scripts/bump-version.sh
  • scripts/ojd
  • scripts/ojd-build.sh
  • scripts/ojd-dmg-background.py
  • scripts/ojd-package.sh

📝 Walkthrough

Walkthrough

This release adds automatic update checking from GitHub alongside a packaging infrastructure overhaul switching from ZIP to DMG distribution. It bumps the version to 0.2.0 across all build artifacts and introduces SemanticVersion parsing for version comparison logic. The feature includes a new menu-bar UI section for checking updates and opening releases.

Changes

Version 0.2.0 Release with Update Checking and DMG Packaging

Layer / File(s) Summary
SemanticVersion parsing and comparison
Sources/OpenJoystickDriverKit/Update/SemanticVersion.swift, Tests/OpenJoystickDriverKitTests/SemanticVersionTests.swift
SemanticVersion parses SemVer 2.0.0 strings (with optional leading v, prerelease, and build metadata) and implements Comparable ordering. Core version components (major/minor/patch) are compared numerically, then prerelease segments follow SemVer precedence rules: empty prerelease sorts higher than non-empty, numeric identifiers sort before non-numeric, and numeric identifiers use length-aware ordering. Comprehensive tests validate parsing, comparison, edge cases, and nil returns for invalid inputs.
UpdateChecker service
Sources/OpenJoystickDriver/App/UpdateChecker.swift
UpdateChecker fetches the latest GitHub release from /repos/.../releases/latest, decodes the JSON response (rejecting drafts), parses the tag as SemanticVersion, and compares it against the provided current version. Returns UpdateCheckState.available(UpdateInfo) when a newer version is found or .upToDate otherwise; network/parse/validation errors convert to .failed. A private async data(for:) helper bridges URLSession.dataTask to async/await.
Update checking UI and AppModel integration
Sources/OpenJoystickDriver/App/AppModel.swift, Sources/OpenJoystickDriver/Views/MenuBarPopoverView.swift
AppModel adds @Published updateCheckState, an appVersion property extracted from Bundle.main, and an UpdateChecker instance. The start() method launches an async checkForUpdates() task. MenuBarPopoverView now includes an "Updates" section with a check button; clicking shows conditional UI for idle, checking, up-to-date, available (with open-release action), and failed states.
DMG background image generation
scripts/ojd-dmg-background.py
New Python script deterministically generates a PNG background for DMG distribution. It defines a bitmap FONT for glyph-based text rendering, provides chunk() to build PNG chunks with CRC32 checksums, in_text() to rasterize characters, and pixel() to return RGB values by coordinate-based region checks. The main() function scans all pixels, compresses output with zlib, and writes a valid PNG file.
Release packaging refactor from ZIP to DMG
scripts/ojd-package.sh
ojd-package.sh replaces ZIP packaging with a full DMG creation flow. New helper functions detect and safely detach DMG mounts and clean up working directories. The packaging sequence stages the built .app, generates a background image via the new Python script, creates and mounts a read-write DMG, applies Finder view styling via embedded AppleScript, detaches, converts to a compressed DMG, and optionally codesigns (conditional on CODESIGN_IDENTITY). Final verification includes DMG validation and app signature re-verification.
Version bump script and reference updates
scripts/bump-version.sh
bump-version.sh discovers and updates additional files: scripts/ojd-build.sh (GUI and daemon bundle versions) and DriverKitExtension/Info.plist (DriverKit extension version). Changelog verification switches from regex to fixed-string grep. The embedded Python updater now accepts multiple file paths with distinct regex patterns for each, enforces minimum occurrence counts via re.subn, and exits with failure if any expected version reference is missing.
Version string updates across codebase
scripts/ojd-build.sh, Sources/OpenJoystickDriver/CLI.swift, DriverKitExtension/Info.plist, scripts/ojd
CFBundleShortVersionString is updated to 0.2.0 in the GUI app bundle, daemon bundle, and DriverKit extension. CLI --version and help output change to v0.2.0. The ojd script help text is updated to describe package release as producing a DMG.
Release workflow and documentation updates
.github/workflows/release.yml, CHANGELOG.md, scripts/README.md
GitHub Actions release workflow now publishes *.dmg instead of *.zip artifacts. CHANGELOG.md adds a ## 0.2.0 section documenting new Xbox 360 rumble support and DMG packaging (switching from zip-only distribution). scripts/README.md updates release packaging examples to show the ojd package release 0.2.0 command and DMG output path, and GitHub Actions docs reference SemVer tags including 0.2.0 and DMG artifacts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop, a skip, to version new,
With SemanticVersion logic true,
Updates check from GitHub's nest,
DMG-wrapped, our app looks best!
Version bumped, the scripts align,
Release day shines—0.2.0 divine! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release-020-update-dmg
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch release-020-update-dmg

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.21.0)

OpenGrep fatal error (exit code 2):
┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m
[00.28][ERROR]: Error: exception Glob.Lexer.Syntax_error("malformed glob pattern: missing ']'")
Raised at Glob__Lexer.syntax_error in file "libs/glob/Lexer.mll", line 8, characters 2-26
Called from Glob__Lexer.__ocaml_lex_token_rec in file "libs/glob/Lexer.mll", line 29, characters 26-53
Cal


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

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

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