Skip to content

Branches and Releases

jayjay181818 edited this page Nov 17, 2026 · 1 revision

Branches and Releases

How changes reach users: which branches exist, how a release is cut, how builds are numbered, signed and offered through the update feeds. The canonical text is the "Branches, releases and dependencies" and "Release builds and updates" sections of Docs/Development.md. For the user's side of updates, see Updates and Channels.

The branches

Branch Used for Builds
testing Where every ordinary change lands, through a pull request. Releases are tagged here. A testing build for every merge (Testing channel); a stable release for every version tag vX.Y.Z (Stable and Testing channels)
main The released code. Brought up to date from testing after each release. None: nothing is built from main
experimental Major changes only (overhauls of the app) or temporary testing. When it is not in use it is brought up to the latest release and left there. An experimental build for every merge (Experimental channel)

The rule, decided by the repository owner on 2026-11-17:

  • Ordinary changes and fixes go through pull requests into testing.
  • testing is promoted to main with each release.
  • experimental is used only for major changes or temporary testing, so the Experimental channel may go quiet for long periods. While it is idle it still offers the latest release.

Work on a branch and open a pull request into testing; never push to testing or main directly. CI runs on every pull request to either of those two branches. A ruleset blocks deletion and force-pushes on main and testing.

What each push builds

The release workflow runs on four kinds of push:

Push Result
To testing (a merged pull request) A testing build, published as the prerelease testing-<build> and offered on the Testing channel
To experimental (a merged pull request) An experimental build, published as the prerelease experimental-<build> and offered on the Experimental channel alone
A tag vX.Y.Z A stable release: Stockbar-X.Y.Z.zip attached to the release for the tag, with Changelogs/release_notes_vX.Y.Z.md as its notes, offered on the Stable and Testing channels
To a release-test/… branch A dry run: built and signed the same way, kept for a week as a workflow artifact, nothing published. A name starting release-test/experimental is a dry run of an experimental build.

CI (ci.yml) runs for main and testing, not for experimental. A push to experimental is built and published by the release workflow, which runs none of the tests; the checks for that branch are run locally (see Development).

Build numbers

Kind Build number Example
Stable The version without dots 3.6.0 is 360
Testing The build of the last version tag, a dot, and the number of commits since that tag 360.14
Experimental The build of the last version tag, the number of commits since that tag that testing also has, and the number it does not 360.9.5

Sparkle compares the parts as numbers, so 360 < 360.14 < 370, and an experimental build sorts just above the testing build it contains and below the next one (360.9 < 360.9.5 < 360.10). To Sparkle a missing part is 0, so 360.9.0 is the same build as 360.9 and 360.0.0 is the same as the release 360.

Consequences:

  • A testing build keeps the old base until the new tag exists, even after release.sh has moved the project to the next version.
  • The workflow refuses a version tag that disagrees with the project or that is on neither testing nor main.
  • It refuses a testing build when the newest version tag is missing from the history of testing, because that build would sort below the release and never be offered. Keep testing up to date with whatever carries the newest tag. The same rule applies to experimental.
  • The workflow builds only the newest commit of experimental, because an older commit built later could be numbered above a newer one.
  • Because Sparkle never moves to a lower build number, the way to withdraw a build is to publish a newer one.

Cutting a release

  1. Branch from testing and write Changelogs/release_notes_vX.Y.Z.md, plus a release-history entry headed "Version X.Y.Z" in the README.
  2. Run bash script/release.sh X.Y.Z. It sets MARKETING_VERSION and CURRENT_PROJECT_VERSION in the project and the version line at the foot of the README. It stops if the release notes or the README entry are missing, and refuses a minor or patch number above 9, because the build number is the version without dots. It changes files only; it does not commit, tag or push. The checks command fails when the places disagree.
  3. Open a pull request into testing and merge it. The merge publishes a testing build.
  4. Tag the merge commit on testing with an annotated tag vX.Y.Z and push the tag. The release workflow builds the app, signs it, adds it to the feed and publishes the GitHub release with the release notes as its body.
  5. Bring main up to date with a pull request from testing.

The same checks apply to every change: before publishing, search the diff for credentials, tokens, private hostnames, personal paths and real portfolio data.

Promoting experimental

Used only after a major piece of work on experimental (see Performance and Benchmarks for the record of the last one). It is done at the owner's word.

  1. Open the pull request into testing from a temporary branch at the same commit, never from experimental itself. GitHub deletes a merged pull request's branch, and only main and testing are protected from deletion.
  2. Merge it with a merge commit, so each change stays a commit that can be reverted alone.
  3. Straight afterwards, merge testing back into experimental through a pull request, again with a merge commit. After a squash the commit on testing is not in the history of experimental, and its builds stay numbered below the testing build.

Signing the app

package_release.sh builds the Release configuration, signs it ad hoc with the hardened runtime, zips it, then unpacks the archive and checks that the app starts. There is no Apple developer account, and no name or address of a person goes into a build. Three consequences:

  • macOS blocks the first launch of a downloaded copy until the user chooses Open Anyway (once per Mac). Updates installed by Sparkle are not blocked. See Installation.
  • macOS asks for Keychain access again after every update. Every credential is in one Keychain item, so it asks once. A self-signed certificate was tried and does not help: for any signature not issued by Apple, macOS ties Keychain access to the exact build. See Updates and Channels.
  • The hardened runtime refuses to load a framework from another signer unless library validation is off, and an ad hoc build shares no signer with the Sparkle framework inside it. Stockbar.entitlements therefore carries com.apple.security.cs.disable-library-validation, the only entitlement Scripts/validate_entitlements.sh allows.

The script refuses to package a build whose signature names a certificate or a team, or whose binaries contain a home-folder path other than the build runner's. It also refuses an app whose executable carries test-coverage counters. A release must not be signed with an Apple Development certificate, because on a free account its name contains the Apple ID.

Signing the update

Sparkle installs an update only if it is signed with the EdDSA key whose public half is SUPublicEDKey in Stockbar/Info.plist. The private half is a GitHub Actions secret. Without the private key no installed copy can be updated again, and anyone holding it can sign an update that installed copies will accept, so it must be backed up and kept private. sign_release.sh signs the archive, checks the signature against the key inside that archive's own app, so that a wrong secret fails before anything is published, adds the build to the feed and signs the feed.

The feeds

Feed Branch Holds Read by
Stable and Testing appcast (a file appcast.xml alone on the branch) The 3 newest stable and 10 newest testing builds; testing builds older than the newest stable one are dropped The address in SUFeedURL
Experimental appcast-experimental The 10 newest experimental builds and nothing else StockbarExperimentalFeedURL, when the Experimental channel is chosen
  • Only the workflow writes these branches, and it never force-pushes. Because SURequireSignedFeed is on, the app ignores a feed whose signature does not match, so editing the file by hand breaks it for everyone.
  • release_feed.py keeps the feeds apart: it refuses to add an experimental build to the first feed or any other build to the second. A run removes only the prereleases of the feed it wrote. After a run, the workflow deletes the testing-<build> prereleases and tags that the feed no longer lists.
  • Someone on the Experimental channel gets a release or a testing build only once experimental has been brought up to date with it.
  • Both feeds are signed with the same key.

In the app

AppUpdateService.swift owns the updater. It stays off in Debug builds, in test and acceptance runs (unless the feed is on this Mac), and in a bundle with no feed address or key. See Architecture.

Trying a release locally

bash script/package_release.sh --build 360.1 --output build/release produces the same archive the workflow does. Scripts/tests/test_release_feed.py covers build numbering and the feed. To try an update end to end, build two archives with different build numbers and a feed address on 127.0.0.1, sign them with a throwaway key, and serve the feed locally. Never use the real key or the real feed for a trial.

Dependency updates

Dependabot opens weekly, grouped pull requests into testing, and a weekly workflow proposes a refresh of the locked Python packages. See Development.

Clone this wiki locally