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
bach versionwrites the new version intobach.tomland your other version files. If the tag already exists, it stops.- For Node.js projects, dependencies are installed from your lock file.
- The change is committed as
Release v<version>and tagged, but not pushed yet. - Your app is built.
- The commit and tag are pushed. If anything before this failed, nothing was pushed.
- The installer is built with the Bach GitHub Action, and published with
latest.jsonas a GitHub release.
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, allowgithub-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-outsign-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
Runbach 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.