# Release Process
This document describes the automated release process for py2pyd.
## Automated Release Workflow
### How it works
1. **Version Detection**: When code is pushed to the `main` branch, the CI system automatically checks if the version in `Cargo.toml` has changed.
2. **Automatic Tagging**: If a new version is detected, the system automatically creates a Git tag (e.g., `v0.1.1`) and pushes it to the repository.
3. **Multi-platform Builds**: The system builds binaries for multiple platforms:
- Windows (x86_64)
- Linux (x86_64)
- macOS (x86_64 and ARM64)
4. **Release Creation**: A GitHub release is automatically created with:
- Release notes generated from commit messages
- Binary artifacts for all platforms
- Proper versioning and tagging
### Triggering a Release
To trigger an automatic release:
1. **Update the version** in `Cargo.toml`:
```toml
[package]
version = "0.1.1" # Increment this version
```
2. **Commit and push** to main branch:
```bash
git add Cargo.toml
git commit -m "bump: version 0.1.1"
git push origin main
```
3. **Wait for CI**: The automated release workflow will:
- Detect the version change
- Build binaries for all platforms
- Create a Git tag
- Create a GitHub release with artifacts
### Manual Release
For manual releases or re-releases, you can use the Manual Release workflow:
1. Go to **Actions** tab in GitHub
2. Select **Manual Release** workflow
3. Click **Run workflow**
4. Enter the tag name (e.g., `v0.1.1`)
5. Click **Run workflow**
## Workflow Files
### `.github/workflows/auto-release.yml`
- **Trigger**: Push to main branch (excluding documentation changes)
- **Purpose**: Automatic version detection and release creation
- **Features**:
- Version change detection
- Multi-platform builds
- Automatic tagging
- Release creation with artifacts
### `.github/workflows/release.yml`
- **Trigger**: Manual dispatch or tag push
- **Purpose**: Manual release creation
- **Features**:
- Manual workflow dispatch
- Same build matrix as auto-release
- Supports re-releasing existing tags
## Build Matrix
The release workflows build for the following targets:
| Windows | `x86_64-pc-windows-msvc` | `py2pyd-windows-x86_64.zip` |
| Linux | `x86_64-unknown-linux-gnu` | `py2pyd-linux-x86_64.tar.gz` |
| macOS (Intel) | `x86_64-apple-darwin` | `py2pyd-macos-x86_64.tar.gz` |
| macOS (ARM) | `aarch64-apple-darwin` | `py2pyd-macos-aarch64.tar.gz` |
## Release Artifacts
Each release includes:
- Compiled binary (`py2pyd` or `py2pyd.exe`)
- `README.md`
- `LICENSE`
- Platform-specific archive (`.zip` for Windows, `.tar.gz` for Unix)
## Version Management
- Follow [Semantic Versioning](https://semver.org/)
- Update version in `Cargo.toml` only
- The CI system handles Git tagging automatically
- Release notes are generated from commit messages
## Troubleshooting
### Release not triggered
- Check if version in `Cargo.toml` actually changed
- Ensure the commit was pushed to `main` branch
- Check if the path is excluded (documentation changes are ignored)
### Build failures
- Check the Actions tab for detailed error logs
- Common issues:
- Missing dependencies
- Compilation errors
- Target-specific build issues
### Missing artifacts
- Verify all build jobs completed successfully
- Check artifact upload steps in the workflow logs
- Ensure file paths in the workflow match actual build outputs
## Security
- The workflows use `GITHUB_TOKEN` for authentication
- No additional secrets are required
- All builds run in GitHub's secure environment
- Artifacts are signed by GitHub's infrastructure