# Release Checklist

## Prerequisites

- [ ] Bitbucket Pipeline variables configured:
  - `CARGO_REGISTRY_TOKEN` — crates.io API token with publish-update scope
  - `ATLASSIAN_ACCOUNT_EMAIL` — Atlassian account email
  - `ATLASSIAN_API_TOKEN` — API token from https://id.atlassian.com/manage-profile/security/api-tokens

## Release Process

### 1. Prepare the release

```bash
# Update version in Cargo.toml
# Update CHANGELOG if you have one
# Commit changes
git add Cargo.toml Cargo.lock
git commit -m "release: v0.2.0"
```

### 2. Tag and push

```bash
git tag v0.2.0
git push origin master --tags
```

This triggers the Bitbucket Pipeline which:
- Builds `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl`
- Uploads binaries to [Bitbucket Downloads](https://bitbucket.org/thermsio/fafb-q/downloads/)
- Uploads `scripts/install.sh` to Bitbucket Downloads (stable URL, overwritten each release)
- Publishes the crate to [crates.io](https://crates.io/crates/fafb-q)

### 3. Build macOS artifacts locally (optional)

Bitbucket Pipelines has no macOS runners, so macOS builds are done locally:

```bash
./scripts/release.sh --target x86_64-apple-darwin --target aarch64-apple-darwin --version v0.2.0
```

### 4. Verify

- [ ] Check [crates.io/crates/fafb-q](https://crates.io/crates/fafb-q) shows the new version
- [ ] Check [Bitbucket Downloads](https://bitbucket.org/thermsio/fafb-q/downloads/) has the Linux tarballs
- [ ] `cargo install fafb-q` installs the correct version
- [ ] `curl -fsSL https://bitbucket.org/thermsio/fafb-q/downloads/install.sh | sh` works

## Ad-hoc builds (no tag)

Run the `release-build` custom pipeline from the Bitbucket UI for any branch. Artifacts are named `fafb-q-dev-<sha>-<target>.tar.gz`. This does **not** publish to crates.io.

Locally:

```bash
./scripts/release.sh --all
# Version defaults to dev-<sha>
```
