Skip to main content
bach build exits with a non-zero code and a readable message on any problem, so it fits in a pipeline as it is, on Windows, macOS or Linux. The GitHub Action installs bach, builds the setup file, and can sign it and publish it as a release your installed apps update from.
Don’t want to write the workflow? bach init or bach workflow adds a complete one-click release to your repository: see One-click releases.

The GitHub Action

Build and publish a release for every pushed tag like v1.4.0:
.github/workflows/release.yml
The tag is the app’s version, so there is no second place to keep it. Set [updates] github = "owner/repo" in bach.toml and installed apps update from these releases: see Updates. Or only build, and publish the file yourself:
.github/workflows/build.yml
For an app with [access], store the key as a repository secret and pass it to the action’s step as the environment variable the build reads, BACH_ACCESS_KEY by default:
.github/workflows/release.yml
The action runs bach doctor on the config first, then bach build. It works on Windows, macOS and Linux runners.

Pin the action

usebach/bach@v0 follows the newest 0.x release, @v0.2 the newest 0.2.x, and @v0.2.1 never moves. A full commit SHA never moves either, and builds with the Bach version in that commit’s Cargo.toml. A Bach release moves v0 and v0.2 only after all its downloads are on the release.
Outside Windows the setup file keeps Bach’s icon. Build on windows-latest to apply app.icon.

Without the action

Install bach with the scripts, then build:
Set BACH_NO_PATH to skip changing the user’s PATH on a CI machine.
Pick a version with BACH_VERSION: 0.2.0 for exactly that one, 0.2 or 0 for the newest of that line, latest for the newest. See Environment variables.

A typical release pipeline

  1. Build your app into the folder named by files.source.
  2. Run the Bach action with release: true, and sign-command to sign on a Windows runner (see Signing). It writes the update feed after signing.
  3. Without the action: run bach build, sign with signtool, run bach feed on the signed file, and upload the setup file and latest.json.

Offline or locked-down runners

If the runner cannot download the runtime, keep bach-setup.exe next to bach, pass --runtime PATH, or set BACH_RUNTIME. Set BACH_NO_DOWNLOAD to make bach refuse to download anything.