> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bach builds Windows installers from one bach.toml with the bach command: bach init, bach check, bach preview, bach build. Installs are per user and need no administrator rights by default. installer.scope = "machine" installs for every user after one Windows prompt. On Windows, run setup files with Start-Process -Wait -PassThru in PowerShell, and give signtool arguments that start with the word sign.

# One-click releases from GitHub

> Add Bach's release workflow to your repository and publish a new version by pressing Run workflow: version, build, installer, tag and release.

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:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach init        # a new project: writes bach.toml and the workflow
bach workflow    # a project that already has bach.toml
```

`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:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[updates]
github = "your-name/hello-notes"
```

`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:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
gh workflow run bach-release.yml -f bump=minor
```

| Option | Meaning |
| - | - |
| `bump` | `patch`, `minor` or `major` raises that part of the version. `current` releases the version as it is, for your first release. |
| `version` | An exact version, such as `2.0.0`. Replaces `bump`. |
| `notes` | What's new. Without it, GitHub writes notes from your commits. |
| `prerelease` | A pre-release. Installed apps don't update to it. A version containing `-` is always one. |
| `draft` | Save the release as a draft. |
| `latest` | Turn off when fixing an old version, so apps stay on the newest. |
| `dry_run` | Build everything but publish nothing. The setup file is attached to the workflow run. |

Try `dry_run` the first time:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
gh workflow run bach-release.yml -f bump=current -f dry_run=true
```

## What happens during a release

1. [`bach version`](/docs/reference/cli/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](/docs/guides/ci.md), 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:

| Project | Command |
| - | - |
| Rust | `cargo build --release` |
| Tauri | `npx tauri build --no-bundle` (Tauri 2) |
| Electron | `npx electron-builder --win --dir`, or `npx electron-forge package` |
| .NET | `dotnet publish -c Release -r win-x64 --self-contained` |
| Anything else | a `TODO` line where you add your own commands |

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](/docs/reference/config/requirements.md) commented out. If you change the publish command to `--self-contained false`, uncomment it.

> [!NOTE]
>
> 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](/docs/guides/signing.md).

## 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](/docs/guides/winget.md) pull request after each release, and `--macos` adds a Mac build.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.