> ## 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.

# bach workflow: add the one-click release workflow

> bach workflow [DIR]: writes .github/workflows/bach-release.yml, a release you start under Actions › Release › Run workflow, filled in for your stack.

`bach workflow` writes `.github/workflows/bach-release.yml` into the git repository that holds your `bach.toml`. The file is a release you start with one button. See [One-click releases](/docs/guides/releasing.md) for what it does.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach workflow
bach workflow desktop          # the bach.toml is in the desktop folder
bach workflow --force
bach workflow --pin float
bach workflow --winget Example.Hello
```

| Argument | Default | Meaning |
| - | - | - |
| `DIR` | `.` | The folder with the `bach.toml`. |
| `--force` | off | Replace a `bach-release.yml` that Bach didn't write. |
| `--pin MODE` | `commit` | How the workflow names Bach's action. `commit` writes `usebach/bach@<40-digit commit> # v0.x.y`, the commit of the release you run. `float` writes `usebach/bach@v0`, which moves with every release. |
| `--winget ID` | off | Also add a job that opens the winget-pkgs pull request that updates the package `ID` (like `Example.Hello`) after each release. It needs a repository secret named `WINGET_TOKEN` (a classic token with the `public_repo` scope) and skips itself, with a notice, without one. The first version of an app is submitted by hand with [`bach winget`](/docs/reference/cli/winget). Running `bach workflow` again without the flag keeps the job. |

## Behaviour

* It needs a `bach.toml` in the folder and a git repository around it, and stops with a sentence saying which is missing.
* It fills in the install and build steps for Rust, Tauri, Electron and .NET projects, and for the package manager the lock file names (npm, pnpm, Yarn or Bun). For an unrecognised project the **Build your app** step holds a `TODO`.
* The workflow publishes with a write token, so Bach's action is pinned to the commit of the Bach release you run, found with `git ls-remote` on `github.com/usebach/bach`. If that fails (no network, or git is missing), it writes `@v0`, says so, and pins when you run `bach workflow` again online. The file explains how to keep the pin current with Dependabot: add `package-ecosystem: github-actions` to `.github/dependabot.yml`.
* A file that starts with `# Generated by Bach` is updated in place. Any other file with that name is left alone unless you pass `--force`.
* If the repository has no GitHub `origin`, it says so: the workflow appears under Actions once the repository is on GitHub.
* `bach init` calls this for you in a GitHub checkout; `bach init --no-workflow` skips it.


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