Skip to content

Every merge can publish a GitHub release with the app: make publish - #215

Closed
pitis wants to merge 2 commits into
mainfrom
feat/publish-releases
Closed

pitis wants to merge 2 commits into
mainfrom
feat/publish-releases

Conversation

@pitis

@pitis pitis commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • make publish [version=0.2] (scripts/publish.sh): builds origin/main's Release app in worktrees/publish (doesn't install it, so the running app stays open), zips Hush.app and creates the GitHub release v<version> on that commit, titled Hush <version>, with the commit's subject as notes.
  • Versions: v0.1 first, then each run bumps the last number (0.1.1, 0.1.2, …). version=0.2 starts a new line (0.2, 0.2.1, …). It refuses a version that's already released or not major.minor.
  • Re-running on a commit that already has a release does nothing.
  • make bundle: the build half of make release, which now depends on it. make release itself is unchanged.
  • CLAUDE.md: the merge step runs make publish. worktrees/publish stays so later builds reuse its output.

Why

So each merged change has a downloadable, versioned build.

Needs the owner

This Mac has no Apple Development certificate (security find-identity -p codesigning finds 0), and app/project.yml signs with it. Until it's in the login keychain, make publish stops at signing. The installed /Applications/Hush.app is ad-hoc signed today.

The repo is public, so every release zip can be downloaded by anyone.

How it was tested

  • scripts/publish.sh in a throwaway repo with a local origin, stub make (fakes the built app) and stub gh (logs its call and checks the zip holds Hush.app/Contents/MacOS/Hush). Ten cases:
    • no releases → v0.1
    • after v0.1 → v0.1.1
    • after v0.1.10 → v0.1.11 (numeric sort)
    • version=0.2 → v0.2; then → v0.2.1
    • commit already released, with a plain or an annotated tag → skipped, gh not called
    • version=0.2 again → refused
    • version=0.5.1 → refused
    • version=0.5 → v0.5
    • the release targets origin/main's sha, and worktrees/publish follows origin/main between runs
  • make -n release runs the bundle steps, then the install.
  • Real make bundle in a fresh worktrees/publish at this branch, ad-hoc signed (no certificate here): builds Hush.app (31 MB executable). The script's ditto zip is 13 MB, and the unzipped app passes codesign --verify --deep --strict.
  • No make check: no Rust or Swift changed, so the gate has nothing of this PR to test. bash -n passes; shellcheck isn't installed.

Closes #122

@pitis

pitis commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Review (code, error handling, comments) and fixes

Fixed (commit 6975fe5):

  1. Two runs at once could publish a mixed build. A second make publish would switch the sources under the first one's build, which could then ship as the first commit. Now lockf lets only one run at a time; a second exits with "another make publish is running".
  2. The main checkout could get detached. If worktrees/publish existed without its .git (an interrupted delete), git -C fell through to the main checkout and detached it. The script now checks for $dir/.git, so git worktree add fails loudly instead.
  3. Local changes in worktrees/publish were built and published as origin/main. Examples: a hand edit to project.yml signing, or a stray .swift file, which XcodeGen picks up from the folder. The script now refuses with "has local changes; nothing published".
  4. A stale or stray Hush.app. An incremental build can keep files that main deleted. And the built app stayed in worktrees/publish/build, where Spotlight or the Dock can launch it instead of /Applications. Now the bundle is removed before each build and after the run, even when the run fails. The expensive caches (core/target, Xcode intermediates) stay.
  5. version= below the latest release was accepted, and the next run then continued from the higher one. Now a new line must be above every release. version= on a commit that's already released says it wasn't used.
  6. Comments. The skip rule is about a v… tag on origin (deleting a release keeps its tag), the version rule is "next patch of the highest tag", and the ls-remote line format covers annotated tags. CLAUDE.md now says worktrees/publish is safe to remove and not for hand builds. The release help says it quits the running app.

Declined:

  • An extra "build failed; nothing published" line: make already ends with the xcodebuild error and Error 65, and set -e stops before the zip.

For the owner (not changed):

  • The app inside the zip has no version string (CFBundleShortVersionString), so an unzipped Hush can't tell you it's 0.1.3. The issue doesn't ask for it.

Re-tested: the ten earlier cases plus these new ones, in a throwaway repo with stub make and gh, all as expected:

  • a version below or equal to the latest release is refused
  • a dirty publish worktree is refused
  • a second run while one holds the lock is refused
  • a publish folder without .git fails, and the main checkout stays on main
  • no Hush.app is left after a run
  • a removed worktree is recreated

@pitis

pitis commented Nov 29, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #285: make publish now builds the GPUI app's Hush.app (make bundle), reusing this PR's script and its version rules, and a release workflow adds Windows and Linux.

@pitis pitis closed this Nov 29, 2026
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.

Every merge publishes a GitHub release with the app

1 participant