Skip to Content

Release

Build process

App bundle

scripts/build-app.sh creates a signed app bundle:

  1. Builds the BucklerApp target in release mode
  2. Creates the bundle structure with Contents/MacOS/, Contents/Resources/
  3. Copies the app icon and Info.plist from scripts/
  4. Signs the bundle with hardened runtime

Local builds use an ad-hoc signature. Release builds use a Developer ID certificate.

Release package

scripts/release.sh makes a release of main. Run it after each merge to main, when scripts/e2e.sh passes. Buckler uses two repositories:

RepositoryVisibilityHolds
caretak3r/bucklerPrivateThe source code, the version commits and the vX.Y.Z tags
caretak3r/homebrew-bucklerPublicThe GitHub releases with the zip files, the Homebrew cask, the README and its images

The script does these steps:

  1. It reads the commits since the last vX.Y.Z tag and finds the next version (see Version rule).
  2. It writes the version with scripts/version.sh set and moves the Unreleased notes in CHANGELOG.md under the new version. If Unreleased is empty, it writes the notes from the commit subjects.
  3. It builds Buckler.app with build-app.sh and makes build/Buckler-X.Y.Z.zip.
  4. It commits chore(release): vX.Y.Z, tags vX.Y.Z and pushes both to the private repository.
  5. It publishes a GitHub release in the public repository with the zip file and the changelog section.
  6. It copies tap/README.md and tap/images to the public repository, writes Casks/buckler.rb with the new version and SHA-256, and commits and pushes Buckler X.Y.Z. The local clone of the public repository is build/tap.
scripts/release.sh --dry-run # show the next version and the notes, change nothing scripts/release.sh # release main scripts/release.sh --major # force a major release

The script stops when the branch is not main, when the working tree has changes, when main differs from origin/main, or when it cannot reach the public repository. It exits without a release when no commits come after the last tag, except release and cask commits.

Version rule

The script uses the Conventional Commits types since the last tag:

Commits since the last tagNext version
A type with ! (for example feat!:), or a BREAKING CHANGE: footerMAJOR
Any feat or fixMINOR
Only other types (docs, test, chore, refactor, …)PATCH

Merge commits, chore(release): and chore(cask): commits do not count.

Signing

Release builds require:

  • A Developer ID Application certificate in the Keychain
  • Hardened runtime entitlements (already configured in build-app.sh)

The script signs with:

codesign --force --sign "Developer ID Application: ..." \ --options runtime \ Buckler.app

Notarization

Notarization uses notarytool with a keychain profile.

Create the profile once:

xcrun notarytool store-credentials NOTARY_PROFILE \ --apple-id "your-apple-id" \ --team-id "YOUR_TEAM_ID" \ --password "app-specific-password"

Submit the release archive:

xcrun notarytool submit buckler-VERSION.zip \ --keychain-profile NOTARY_PROFILE \ --wait

Staple the ticket to the app:

xcrun stapler staple Buckler.app

Status: Developer ID notarization is planned but not automated yet.

Homebrew cask

scripts/release.sh writes Casks/buckler.rb in the public repository for each release. Do not edit it by hand. The public repository is the tap: brew tap caretak3r/buckler clones caretak3r/homebrew-buckler. The cask downloads the zip file from the public release, so a GitHub token is not necessary. It installs Buckler.app and links buckler, the command line tool in Buckler.app/Contents/Helpers.

brew tap caretak3r/buckler brew trust caretak3r/buckler brew install --cask caretak3r/buckler/buckler

README images

The images in the README of both repositories are in tap/images. scripts/screenshots.sh makes them again: it runs the built app on the e2e demo data, light and dark, and captures the status menu, the Findings window, the Providers window and the General pane of Settings.

bash scripts/build-app.sh bash scripts/screenshots.sh

The script needs the same permissions as the UI step of e2e.sh, and the menu bar must be visible. Like the UI step, it opens windows and menus on your screen, so do not use the Mac while it runs. The next release copies the new images to the public repository.

Versioning

The file VERSION at the repository root is the one version source. It holds a version as X.Y.Z. scripts/version.sh writes the version to the files that need a copy:

FileHolds
VERSIONThe source
Sources/BucklerCore/Version.swiftBucklerVersion.current, which buckler --version and the About pane print
scripts/Info.plistCFBundleShortVersionString

Do not edit the copies by hand. Use the script:

scripts/version.sh show # print the version scripts/version.sh set 0.2.0 # set an exact version scripts/version.sh bump patch # or minor, or major scripts/version.sh check # exit 1 when the files disagree scripts/version.sh check v0.2.0 # also compare a release tag

check prints one line for each file that does not match VERSION, and exits with code 1. With a tag, it also fails when the tag is not v followed by the version. Run it in CI before a release.

The build number (CFBundleVersion) is not in the source tree. scripts/build-app.sh stamps it into the built bundle only. The value is the CI run number (GITHUB_RUN_NUMBER). Without CI it is the number of commits (git rev-list --count HEAD). Without git it is 0. build-app.sh runs version.sh check first and stops when the files disagree.

CHANGELOG.md follows Keep a Changelog. Put each change under Unreleased. scripts/release.sh moves the Unreleased notes under the new version.

Checklist

For each release:

  • Merge to main through the gate: swift build, swift test and scripts/e2e.sh pass. When the merge changes the UI, also run scripts/e2e.sh --ui while you do not use the Mac
  • Run scripts/release.sh
  • Check the release page of the public repository and the new tag

Before Buckler is announced:

  • Sign with a Developer ID certificate and notarize (NOTARY_PROFILE), so users do not have to remove the quarantine attribute
Last updated on