Documentation
Release Guide
This guide explains how to create a new release of the ad-blocking repository with automatically built binaries.
Overview
The repository uses GitHub Actions to automatically build and attach binaries to releases when a new version tag is pushed. The release workflow builds:
- AdGuard.ConsoleUI - .NET Console UI for AdGuard DNS API (Windows, Linux, macOS)
- RulesCompiler.Console - .NET rules compiler console app (Windows, Linux, macOS)
- rules-compiler - Rust rules compiler (Windows, Linux, macOS)
- rules-compiler - Python wheel package (cross-platform)
Creating a Release
1. Prepare the Release
Before creating a release, ensure:
- All changes are merged to the
mainbranch - All tests pass in CI/CD
- Version numbers are updated in project files if needed:
src/adguard-api-dotnet/src/AdGuard.ConsoleUI/AdGuard.ConsoleUI.csprojsrc/rules-compiler-dotnet/src/RulesCompiler.Console/RulesCompiler.Console.csprojsrc/rules-compiler-rust/Cargo.tomlsrc/rules-compiler-python/pyproject.toml
2. Create and Push a Tag
Create a new version tag following semantic versioning (e.g., v1.0.0, v1.1.0, v2.0.0-beta):
# Create a new tag
git tag -a v1.0.0 -m "Release version 1.0.0"
# Push the tag to GitHub
git push origin v1.0.0
3. Wait for the Workflow to Complete
Once the tag is pushed:
- The Release Binaries workflow will automatically start
- Monitor the workflow progress at:
https://github.com/jaypatrick/ad-blocking/actions/workflows/release.yml - The workflow will:
- Build .NET executables for Windows, Linux, and macOS
- Build Rust binaries for Windows, Linux, and macOS
- Build Python wheel package
- Create a GitHub release with all binaries attached
The complete workflow typically takes 15-20 minutes to complete all builds.
4. Verify the Release
After the workflow completes:
- Go to the Releases page
- Find your new release (e.g.,
v1.0.0) - Verify that all binaries are attached:
AdGuard.ConsoleUI-windows.zipAdGuard.ConsoleUI-linux.tar.gzAdGuard.ConsoleUI-macos.tar.gzRulesCompiler.Console-windows.zipRulesCompiler.Console-linux.tar.gzRulesCompiler.Console-macos.tar.gzrules-compiler-rust-windows.ziprules-compiler-rust-linux.tar.gzrules-compiler-rust-macos.tar.gzrules_compiler-*.whl(Python wheel)
5. Edit Release Notes (Optional)
The release is created with auto-generated notes. You can edit the release to:
- Add a changelog with notable changes
- Highlight breaking changes
- Add migration instructions if needed
- Reference related issues or pull requests
Build Artifacts
.NET Executables
The .NET executables are built as self-contained, single-file binaries with trimming enabled. This means:
- No .NET runtime installation required on target systems
- Single executable file per application
- Optimized size through trimming
- Includes all dependencies
Rust Binaries
The Rust binaries are built in release mode with:
- Link-Time Optimization (LTO) enabled
- Single codegen unit for maximum optimization
- Debug symbols stripped
- Minimal binary size
Python Wheel
The Python wheel package is built as a universal wheel compatible with Python 3.9+.
Troubleshooting
Workflow Fails
If the release workflow fails:
- Check the workflow logs for error messages
- Common issues:
- Build failures due to compilation errors
- Missing dependencies in project files
- Network issues downloading dependencies
- Insufficient permissions (requires
contents: write)
Missing Binaries
If some binaries are missing from the release:
- Check the individual job logs in the workflow
- Verify the artifact upload steps completed successfully
- Ensure the
create-releasejob downloaded all artifacts
Rebuilding a Release
To rebuild a release:
- Delete the existing release and tag from GitHub
- Delete the local tag:
git tag -d v1.0.0 - Create a new tag and push again
Manual Release (Alternative)
If the automated workflow is not working, you can manually build and release:
Build .NET Executables
# AdGuard Console UI
cd src/adguard-api-dotnet/src/AdGuard.ConsoleUI
dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -o ./publish/win-x64
dotnet publish -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true -o ./publish/linux-x64
dotnet publish -c Release -r osx-x64 --self-contained -p:PublishSingleFile=true -o ./publish/osx-x64
# Rules Compiler Console
cd ../../../rules-compiler-dotnet/src/RulesCompiler.Console
dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -o ./publish/win-x64
dotnet publish -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true -o ./publish/linux-x64
dotnet publish -c Release -r osx-x64 --self-contained -p:PublishSingleFile=true -o ./publish/osx-x64
Build Rust Binary
cd src/rules-compiler-rust
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target x86_64-pc-windows-msvc
cargo build --release --target x86_64-apple-darwin
Build Python Wheel
cd src/rules-compiler-python
python -m build
Create Release Manually
- Go to Create a new release
- Choose your tag
- Add release notes
- Upload all the built binaries
- Publish the release
Best Practices
- Version Numbering: Follow Semantic Versioning
- MAJOR version for incompatible API changes
- MINOR version for new functionality in a backwards compatible manner
- PATCH version for backwards compatible bug fixes
- Pre-releases: Use tags like
v1.0.0-beta,v1.0.0-rc1for pre-releases - Testing: Test the built binaries on all platforms before announcing the release
- Documentation: Update the main README.md with notable changes
- Changelog: Consider maintaining a CHANGELOG.md file
Related Files
.github/workflows/release.yml- Release workflow definitionsrc/adguard-api-dotnet/src/AdGuard.ConsoleUI/AdGuard.ConsoleUI.csproj- .NET Console UI projectsrc/rules-compiler-dotnet/src/RulesCompiler.Console/RulesCompiler.Console.csproj- .NET Rules Compiler projectsrc/rules-compiler-rust/Cargo.toml- Rust project configurationsrc/rules-compiler-python/pyproject.toml- Python project configuration
Support
If you encounter issues with releases, please:
- Check existing GitHub Issues
- Review the Actions workflow runs
- Create a new issue with detailed logs if needed