waybetter-for-x/docs/DISTRIBUTION.md
2026-09-30 23:01:13 +00:00

5.8 KiB

Distribution channels (winget, Chocolatey, Homebrew, AUR)

waybetter manifests (framework, waybetter/packages/waybetter/cli/manifests.mjs) writes the files each package manager wants, from one small JSON description. waybetter release windows|macos|linux calls it for this app after the installers exist. It submits nothing and needs no account: what follows is what the owner does by hand, once per channel, and what is automatic afterwards.

What is generated

releases/distribution/<version>/ (git-ignored, like all of releases/), from the distribution block of waybetter.release.json plus the installers in releases/upload (their sha256 is computed there):

Channel Files Installer used
winget winget/manifests/c/CRT/WayBetterForX/<version>/CRT.WayBetterForX{,.installer,.locale.en-US}.yaml (schema 1.28.0, the layout of microsoft/winget-pkgs) the NSIS setup.exe, silent switch /S, per-user scope
Chocolatey chocolatey/waybetter-for-x/waybetter-for-x.nuspec, tools/chocolateyInstall.ps1 (downloads the setup.exe, verifies its sha256) the same setup.exe
Homebrew homebrew/Casks/waybetter-for-x.rb (a cask for our own tap) the universal .dmg
AUR aur/waybetter-for-x-bin/PKGBUILD and .SRCINFO the .deb (unpacked), AppImage-only when there is no .deb

The public download URL of a release is not known to the build. Pass it: --download-base <url> on any waybetter release ... step, or WAYBETTER_DOWNLOAD_BASE, or distribution.downloadBase in the config. Without it the step prints "manifests: skipped" and writes nothing (nothing is guessed). The URL must serve the files under releases/upload by their names (wayBetter-for-X_<version>_x64-setup.exe, ..._universal.dmg, ..._amd64.deb, ..._amd64.AppImage), and the files must already be there when a package manager verifies the hash.

Standalone, for any app: waybetter manifests app.json --out dist-manifests [--download-base <url>] [--only winget,aur]. The description format is in the header comment of cli/manifests.mjs (publisher, id, name, version, shortDescription, homepage, license, per platform url + sha256 or a local file, silentSwitches).

Once per channel (the owner)

winget. Needs a GitHub account (the community repository lives on GitHub; this is the one place the project touches it) and a fork of microsoft/winget-pkgs. First submission: copy the generated manifests/c/CRT/WayBetterForX/<version>/ into the fork, open a pull request, answer the validation bot. The pipeline installs the package on a Windows VM and scans the installer with SmartScreen/antivirus; an unsigned installer can be held for review or flagged, which is why code signing is on the list for the release. Test before submitting: winget validate --manifest <folder> and winget install --manifest <folder> (needs winget settings --enable LocalManifestFiles). After the first accept, later versions are the same pull request with a new folder (or wingetcreate update CRT.WayBetterForX --version <v> --urls <url> --submit, which needs a GitHub token).

Chocolatey. Needs an account on community.chocolatey.org and its API key (choco apikey --key <key> --source https://push.chocolatey.org/). Build and push: cd releases/distribution/<version>/chocolatey/waybetter-for-x, choco pack, choco push waybetter-for-x.<version>.nupkg --source https://push.chocolatey.org/. The first version and every later one go through moderation (automated checks, a virus scan, a human review for new packages); expect a few days for the first one. Test locally: choco install waybetter-for-x --source ..

Homebrew. No account at Homebrew: our own tap is a git repository named homebrew-<something> on any host we control (for example homebrew-tap on the project's git server). Put Casks/waybetter-for-x.rb in it and commit. Users run brew install --cask <owner>/<tap>/waybetter-for-x (with a non-GitHub host: brew tap <owner>/<tap> <git URL> first). The .app is ad-hoc signed, not notarized: the cask installs it, macOS asks the user to allow it (System Settings, Privacy & Security, Open Anyway) the first time. Notarization needs a paid Apple Developer ID and changes that; nothing here does it.

AUR. Needs an account at aur.archlinux.org with an SSH public key added to it. First submission: git clone ssh://aur@aur.archlinux.org/waybetter-for-x-bin.git, copy PKGBUILD and .SRCINFO in, git add, commit, git push. Check on an Arch machine first: makepkg --printsrcinfo > .SRCINFO (must be identical) and makepkg -si. The generated .SRCINFO was compared against the PKGBUILD by the tests, not by makepkg (there is no Arch here).

Automatic afterwards

  • Each waybetter release ... step rewrites releases/distribution/<version>/ from the installers it has at that moment (a channel whose installer is not there yet is skipped and listed). Nothing is pushed, uploaded or submitted by any command.
  • Per release the owner still: uploads the installers first, then copies or pushes the generated files (winget PR, choco push, tap commit, AUR push). Everything in them (version, URL, sha256) is already filled in.
  • The in-app updater does not use these channels; it keeps using latest.json. A package-manager install updates through the package manager as well as through the app's own updater, which is the usual situation for these packages.

Checks that ran

The framework tests (waybetter/packages/waybetter/tests/manifests-cli.test.mjs) parse the YAML back and check it against the winget schema's constraints (required keys, identifier and hash patterns, enums), check the nuspec for well-formedness, syntax-check the PowerShell (Windows) and Ruby/bash (when installed) and compare .SRCINFO with the PKGBUILD. Not run: winget validate, choco pack, brew audit, makepkg (none installed here).