Skip to main content
A Bach project on GitHub can release itself with one button. This page covers how to add the workflow, what it does when you start it, and how the version stays in one place. Installed apps update from what it publishes (see Updates).

Add the workflow

Run one of these in your repository:
bach init adds the workflow by itself when the folder is a git checkout whose origin is on GitHub. bach init --no-workflow skips it. Both write .github/workflows/bach-release.yml. Commit and push it, then start a release on GitHub under Actions › Release › Run workflow, or from a terminal:
Run bach workflow again whenever you want the newest version of the workflow. It only replaces a file that starts with Bach’s own first line. Any other file with that name is left alone unless you pass --force.

The inputs

What a release does

1

Raise the version

Runs bach version, which writes the new version into every file that has one. It stops if v<version> already exists as a tag.
2

Install dependencies

For a Node.js project, installs from the lock file. See Lock files.
3

Commit and tag

Commits Release v<version> locally and tags it. Nothing is pushed yet.
4

Build your app

Builds into the folder [files] source names: cargo build --release for Rust, npx tauri build --no-bundle for Tauri, npx electron-builder --win --dir (or Electron Forge’s package) for Electron, dotnet publish -c Release -r win-x64 --self-contained for .NET. For a project Bach doesn’t recognise, the Build your app step holds a TODO: put your build commands there.
5

Push

Pushes the commit and the tag together. Nothing is pushed if an earlier step failed.
6

Build the installer and publish

Builds the setup file with the Bach action, writes latest.json and publishes both as the GitHub release.
If the last step fails, the tag is deleted again, but the version files on the branch already say the new version. Run the workflow again with bump set to current to retry.
The workflow commits to the branch it runs on. If that branch is protected, let github-actions[bot] push to it, or run the workflow from a release branch.

One version everywhere

The workflow doesn’t edit versions itself. It runs bach version, which you can run by hand too, and which keeps bach.toml, package.json and its lock file, Cargo.toml and Cargo.lock, src-tauri/tauri.conf.json and .csproj files in step. Only the version text changes, so the commit shows one changed line per file. See bach version for the details.

Lock files

The release installs dependencies with the frozen command of your package manager (npm ci, pnpm install --frozen-lockfile, bun install --frozen-lockfile, yarn install --frozen-lockfile or --immutable), picked by the lock file that is committed. If that fails because package.json and the lock file have drifted apart, the workflow recognises the package manager’s message, brings the lock file up to date from package.json (what the lock file pins stays pinned), prints a warning and installs again. The new lock file is part of the release commit. Any other failure stops the release with the real error. For Yarn Classic the lock file is updated with a plain yarn install. With no lock file committed, the workflow runs npm install and says so. Commit a lock file for repeatable releases.

Sign the setup file

The last step holds a commented sign-command input. Remove the #, keep the certificate in a repository secret, and the setup file is signed before the update feed is written, so the feed carries the signed file’s SHA-256. See Signing.

A project in a subfolder

When bach.toml isn’t in the repository’s root, bach workflow desktop (the folder with the bach.toml) writes a workflow whose steps run in that folder. Version files are the ones next to bach.toml.