# Release Checklist

Use this checklist when preparing a new release of xleak. You can also create a GitHub issue using the "Release" template to track progress.

## Pre-Release

- [ ] All tests passing: `cargo test`
- [ ] No clippy warnings: `cargo clippy`
- [ ] Code is formatted: `cargo fmt --check`
- [ ] CHANGELOG.md updated:
  - [ ] Move items from `[Unreleased]` to new `[X.Y.Z] - YYYY-MM-DD` section
  - [ ] Keep `[Unreleased]` section empty for future changes
  - [ ] Verify changelog entries are accurate and complete
- [ ] Version bumped in `Cargo.toml`
- [ ] Test binary works: `cargo run --release -- tests/fixtures/test_comprehensive.xlsx`

## Create Release

- [ ] Commit version bump: `git commit -m "chore: release X.Y.Z"`
- [ ] Push to main: `git push`
- [ ] Create version tag: `git tag vX.Y.Z`
- [ ] Push tag: `git push origin vX.Y.Z`
- [ ] Wait for GitHub Actions workflows to complete (~10-15 minutes)

## Verify Automated Releases

All of the following are now automated via GitHub Actions:

- [ ] **GitHub Release** created at https://github.com/bgreenwell/xleak/releases/tag/vX.Y.Z
  - [ ] All platform binaries present (Linux, macOS, Windows)
  - [ ] Tarballs (.tar.xz, .tar.gz) and ZIP archive
  - [ ] MSI installer for Windows
  - [ ] Shell/PowerShell installer scripts
  - [ ] SHA256 checksum files

- [ ] **Homebrew** formula published to [bgreenwell/homebrew-tap](https://github.com/bgreenwell/homebrew-tap)
  - Automated by: `publish-homebrew-formula` job in release.yml

- [ ] **Scoop** manifest published to [bgreenwell/scoop-bucket](https://github.com/bgreenwell/scoop-bucket)
  - Automated by: `.github/workflows/publish-scoop.yml`

- [ ] **crates.io** published at https://crates.io/crates/xleak
  - Automated by: `publish-crates-io` job in release.yml

- [ ] **AUR** package updated at [xleak-bin](https://aur.archlinux.org/packages/xleak-bin)
  - Automated by: `.github/workflows/publish-aur.yml`
  - PKGBUILD and .SRCINFO auto-generated and pushed

- [ ] **WinGet** manifest PR created to [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs)
  - Automated by: `.github/workflows/publish-winget.yml`
  - **Note:** PR may require manual merge approval from Microsoft team (1-2 days)

## Test Installations

- [ ] **Homebrew (macOS/Linux)**:
  ```bash
  brew update
  brew upgrade xleak
  xleak --version
  ```

- [ ] **Scoop (Windows)**:
  ```powershell
  scoop update
  scoop update xleak
  xleak --version
  ```

- [ ] **AUR (Arch Linux)**:
  ```bash
  yay -Syu xleak-bin
  xleak --version
  ```

- [ ] **WinGet (Windows)**:
  ```powershell
  winget upgrade bgreenwell.xleak
  xleak --version
  ```
  **Note:** May take 1-2 days for WinGet PR to be merged

- [ ] **Shell installer (Linux/macOS)**:
  ```bash
  curl --proto '=https' --tlsv1.2 -LsSf \
    https://github.com/bgreenwell/xleak/releases/latest/download/xleak-installer.sh | sh
  ```

- [ ] **MSI installer (Windows)**: Download and test from GitHub Releases

## Post-Release

- [ ] All automated workflows completed successfully (check GitHub Actions)
- [ ] Announcement published (if applicable)
- [ ] Documentation updated if needed
- [ ] Close release tracking issue

## Troubleshooting

### Common Issues

**GitHub Actions fails:**
- Check workflow logs for specific error
- Verify all secrets are configured: `HOMEBREW_TAP_TOKEN`, `SCOOP_BUCKET_TOKEN`, `CARGO_REGISTRY_TOKEN`, `AUR_SSH_PRIVATE_KEY`, `WINGET_TOKEN`

**Scoop installation broken:**
- Verify manifest in scoop-bucket uses `.zip` file
- Check SHA256 hash matches release artifact

**AUR automation fails:**
- Check SSH key is valid: Secret `AUR_SSH_PRIVATE_KEY`
- Verify PKGBUILD generation in workflow logs
- Fallback: Manual publish (see old checklist in git history)

**WinGet PR not appearing:**
- Check `.github/workflows/publish-winget.yml` logs
- Verify `WINGET_TOKEN` has correct permissions
- May need to create PR manually with `komac update`

**Homebrew formula outdated:**
- Check [homebrew-tap repo](https://github.com/bgreenwell/homebrew-tap) for commit
- Verify `HOMEBREW_TAP_TOKEN` secret is valid

### Manual Intervention Required

If automation fails for a specific channel, you can fall back to manual publishing:

- **AUR Manual Process**: See git history of this file (commit before automation)
- **WinGet Manual Process**: Use `komac update` CLI tool
- **Scoop Manual Process**: Manually edit bucket/xleak.json in scoop-bucket repo

### Workflow Summaries

For detailed workflow information, see:
- `.github/workflows/release.yml` - Main release, Homebrew, crates.io
- `.github/workflows/publish-scoop.yml` - Scoop bucket
- `.github/workflows/publish-aur.yml` - AUR publishing
- `.github/workflows/publish-winget.yml` - WinGet manifests
