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.
The GitHub Action
Build and publish a release for every pushed tag likev1.4.0:
.github/workflows/release.yml
[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
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
Installbach with the scripts, then build:
- Windows runner
- macOS or Linux runner
BACH_NO_PATH to skip changing the user’s PATH on a CI machine.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
- Build your app into the folder named by
files.source. - Run the Bach action with
release: true, andsign-commandto sign on a Windows runner (see Signing). It writes the update feed after signing. - Without the action: run
bach build, sign withsigntool, runbach feedon the signed file, and upload the setup file andlatest.json.
Offline or locked-down runners
If the runner cannot download the runtime, keepbach-setup.exe next to bach, pass --runtime PATH, or set BACH_RUNTIME. Set BACH_NO_DOWNLOAD to make bach refuse to download anything.