Skip to main content
If your code is on GitHub, Bach can give you a release button. Press it and GitHub raises the version number, builds your app, builds the installer and publishes a release that installed apps update from. This page shows how to add it and what each option does.

Add the workflow

In your repository, run one of these:
bach init adds the workflow on its own when your Git checkout’s origin is on GitHub (use --no-workflow to skip it). Both write .github/workflows/bach-release.yml. Commit and push that file. To let installed apps update from these releases, your bach.toml needs:
bach.toml
bach init adds this for you. The repository must be public for updates to work.

Release

On GitHub, open Actions, choose Release, then Run workflow. Or from a terminal with the GitHub CLI:
Try dry_run the first time:

What happens during a release

  1. bach version writes the new version into bach.toml and your other version files. If the tag already exists, it stops.
  2. For Node.js projects, dependencies are installed from your lock file.
  3. The change is committed as Release v<version> and tagged, but not pushed yet.
  4. Your app is built.
  5. The commit and tag are pushed. If anything before this failed, nothing was pushed.
  6. The installer is built with the Bach GitHub Action, and published with latest.json as a GitHub release.
If the last step fails, the tag is deleted again, but the new version number is already committed. Run the workflow again with bump set to current.

The build step

Bach fills in the build commands for projects it recognizes: Open the workflow file and check the Build your app step before your first release. For .NET, the workflow publishes self-contained, so your build carries the runtime and bach init leaves the dotnet requirement commented out. If you change the publish command to --self-contained false, uncomment it.
Bach 0.11.3 and earlier wrote the dotnet requirement uncommented. If your bach.toml has that block and you publish self-contained, delete it.

Protected branches

The workflow commits to the branch it runs on. If the branch is protected, allow github-actions[bot] to push to it, or run releases from a release branch.

Lock files

The release installs dependencies with your package manager’s strict mode (npm ci, pnpm install --frozen-lockfile, bun install --frozen-lockfile, or Yarn’s equivalent), chosen by the lock file you committed. If the lock file no longer matches package.json, the workflow updates it, warns and includes it in the release commit. Without a lock file it runs npm install and says so.

Sign releases

The last step has a commented-out sign-command. Uncomment it and add your certificate as a repository secret, so the file is signed before the update feed is written. See Signing.

Keep the workflow current

Run bach workflow again to get the newest version of the file. It only overwrites a file Bach wrote, unless you pass --force. The workflow uses one exact commit of Bach’s action; bach workflow --pin float uses the newest 0.x release instead. If bach.toml is in a subfolder, run bach workflow <folder>. bach workflow --winget <id> also opens a winget pull request after each release, and --macos adds a Mac build.