# Package Manager Distributions

This directory contains package manager configurations for distributing WebDropBridge across different platforms.

## Directory Structure

```
build/
├── chocolatey/                 # Windows - Chocolatey/NuGet package
│   ├── webdrop-bridge.nuspec   # Package manifest
│   └── tools/
│       ├── chocolateyInstall.ps1   # Installation script
│       └── chocolateyUninstall.ps1 # Uninstallation script
│
└── homebrew/                   # macOS - Homebrew formula
    └── webdrop-bridge.rb       # Homebrew formula
```

## Quick Start

### Chocolatey Package (Windows)

1. **Build MSI installer**:
   ```bash
   python build/scripts/build_windows.py --msi
   ```

2. **Get SHA256 checksum**:
   ```powershell
   certutil -hashfile build/dist/windows/webdrop_bridge/WebDropBridge-<version>-win-x64.msi SHA256
   ```

3. **Update package files**:
   - `build/chocolatey/webdrop-bridge.nuspec` - update `<version>`
   - `build/chocolatey/tools/chocolateyInstall.ps1` - update `$Version` and `$Checksum`

4. **Package it** (requires Chocolatey CLI):
   ```powershell
   cd build/chocolatey
   choco pack webdrop-bridge.nuspec
   ```

5. **Publish** (requires Chocolatey API key):
   ```powershell
   choco push webdrop-bridge.<version>.nupkg --api-key YOUR_KEY
   ```

### Homebrew Formula (macOS)

1. **Build DMG installer**:
   ```bash
   bash build/scripts/build_macos.sh
   ```

2. **Get SHA256 checksum**:
   ```bash
   shasum -a 256 build/dist/macos/webdrop_bridge/WebDropBridge-<version>-macos-universal.dmg
   ```

3. **Update formula**:
   - `build/homebrew/webdrop-bridge.rb` - update `version` and `sha256`

4. **Test locally**:
   ```bash
   brew audit --formula build/homebrew/webdrop-bridge.rb
   brew install build/homebrew/webdrop-bridge.rb
   ```

5. **Publish** (create Forgejo tap or submit to official Homebrew):
   - Option A: Create `homebrew-webdrop-bridge` tap on Forgejo
   - Option B: Submit to `homebrew/casks` on GitHub

## Publishing Strategy

### Recommended Approach for HIM

1. **Chocolatey**:
   - Host in internal Artifactory/Azure Artifacts NuGet repository
   - OR submit to Chocolatey community (chocolatey.org)
   - Users: `choco install webdrop-bridge`

2. **Homebrew**:
   - Create custom tap: `HIM-public/homebrew-webdrop-bridge` on Forgejo
   - Users add tap: `brew tap HIM-public/webdrop-bridge https://git.him-tools.de/...`
   - Users: `brew install webdrop-bridge`

3. **Fallback**:
   - Direct wget/downloads from Forgejo releases
   - Built-in auto-update system in app

## Release Checklist

When releasing version X.Y.Z:

- [ ] Build Windows MSI: `python build/scripts/build_windows.py --msi`
- [ ] Build macOS DMG: `bash build/scripts/build_macos.sh`
- [ ] Calculate checksums (certutil / shasum)
- [ ] Create Forgejo release with installers
- [ ] Update `build/chocolatey/webdrop-bridge.nuspec` version
- [ ] Update `build/chocolatey/tools/chocolateyInstall.ps1` version & checksum
- [ ] Update `build/homebrew/webdrop-bridge.rb` version & checksum
- [ ] Test Chocolatey package locally
- [ ] Test Homebrew formula locally
- [ ] Publish to package managers

## User Installation Commands

After publishing:

```powershell
# Windows
choco install webdrop-bridge
```

```bash
# macOS
brew tap HIM-public/webdrop-bridge https://git.him-tools.de/HIM-public/homebrew-webdrop-bridge.git
brew install webdrop-bridge
```

## References

- [Full Documentation](../../docs/PACKAGE_MANAGER_SUPPORT.md)
- [Chocolatey Docs](https://docs.chocolatey.org/)
- [Homebrew Docs](https://docs.brew.sh/)
- [Forgejo API](https://docs.gitea.com/api/1.22/)
