This document describes how to create a new release of Defenra Agent.
-
Go to GitHub Actions
https://github.com/Defenra/DefenraAgent/actions -
Run "Tag and Release" Workflow
- Click on "Tag and Release" in left sidebar
- Click "Run workflow" button
- Enter version:
1.0.0(without 'v') - Click "Run workflow"
-
Wait (~5 minutes)
- Workflow creates tag
v1.0.0 - Builds binaries for all platforms
- Creates GitHub Release
- Publishes Docker images
- Workflow creates tag
-
Verify
https://github.com/Defenra/DefenraAgent/releases/tag/v1.0.0
# Update CHANGELOG.md first
nano CHANGELOG.md
# Commit and create tag
git add CHANGELOG.md
git commit -m "Release v1.0.0"
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0Defenra Agent uses GitHub Actions to automatically build and publish releases when a version tag is pushed.
-
Go to GitHub Actions
- Navigate to: https://github.com/Defenra/DefenraAgent/actions
- Click on "Tag and Release" workflow
-
Run Workflow
- Click "Run workflow" button
- Enter version number (e.g.,
1.0.0) - Select if it's a pre-release
- Click "Run workflow"
-
Wait for Completion
- The workflow will:
- Create a git tag (
v1.0.0) - Update CHANGELOG.md
- Trigger the release build
- Create a git tag (
- The workflow will:
-
Edit Release Notes
- After the release is created, edit CHANGELOG.md with actual changes
- Commit and push changes
-
Update CHANGELOG.md
# Add new version section nano CHANGELOG.md -
Commit Changes
git add CHANGELOG.md git commit -m "Release v1.0.0" -
Create Tag
git tag -a v1.0.0 -m "Release v1.0.0" -
Push Tag
git push origin v1.0.0
-
Monitor Build
- GitHub Actions will automatically:
- Build binaries for multiple platforms
- Create GitHub Release
- Upload artifacts
- Update Docker Hub
- GitHub Actions will automatically:
The release workflow builds binaries for:
- Linux AMD64 (x86_64)
- Linux ARM64 (aarch64)
- macOS AMD64 (Intel)
- macOS ARM64 (Apple Silicon M1/M2)
Each binary is:
- Compiled with optimizations (
-ldflags "-s -w") - Version information embedded
- Compressed to
.tar.gz - SHA256 checksum generated
- Uploaded to GitHub Release
For version v1.0.0, the following files are created:
defenra-agent-linux-amd64.tar.gz
defenra-agent-linux-amd64.tar.gz.sha256
defenra-agent-linux-arm64.tar.gz
defenra-agent-linux-arm64.tar.gz.sha256
defenra-agent-darwin-amd64.tar.gz
defenra-agent-darwin-amd64.tar.gz.sha256
defenra-agent-darwin-arm64.tar.gz
defenra-agent-darwin-arm64.tar.gz.sha256
Version information is embedded in the binary using ldflags:
// version.go
var (
Version = "dev" // Set to "v1.0.0"
BuildDate = "unknown" // Set to "2025-10-23T10:15:30Z"
GitCommit = "unknown" // Set to "abc12345"
)Check version:
./defenra-agent --version # TODO: Add --version flagDocker images are automatically built and pushed to Docker Hub:
defenra/agent:1.0.0(version tag)defenra/agent:latest(latest release)
Platforms:
linux/amd64linux/arm64
Before creating a release:
- All tests passing
- Documentation updated
- CHANGELOG.md updated with changes
- Version number follows Semantic Versioning
- No critical bugs
- Code reviewed
After release is created:
- Verify all artifacts uploaded
- Test installation script with new version
- Verify Docker image works
- Update documentation if needed
- Announce release
We follow Semantic Versioning (SemVer):
- MAJOR version (1.x.x): Incompatible API changes
- MINOR version (x.1.x): New functionality, backwards compatible
- PATCH version (x.x.1): Bug fixes, backwards compatible
1.0.0- Initial release1.1.0- New feature (GeoDNS improvements)1.1.1- Bug fix (memory leak fix)2.0.0- Breaking change (config format change)
Pre-release versions can be tagged:
v1.0.0-alpha.1- Alpha releasev1.0.0-beta.1- Beta releasev1.0.0-rc.1- Release candidate
Triggered by: Tag push (v*.*.*)
Steps:
- Build - Compile binaries for all platforms
- Create Release - Create GitHub release with notes
- Docker Build - Build and push Docker images
Triggered by: Manual workflow dispatch
Steps:
- Validate version format
- Check if tag exists
- Update CHANGELOG.md
- Create and push tag
- Trigger release workflow
Triggered by: Push to main/develop (excluding tags)
Steps:
- Run tests
- Run linter
- Build binaries (test only)
The install.sh script automatically:
- Detects platform (OS and architecture)
- Fetches latest release from GitHub API
- Downloads pre-built binary
- Verifies SHA256 checksum
- Falls back to building from source if download fails
Users don't need to manually download binaries.
To rollback a release:
-
Mark as Pre-release
- Go to GitHub Releases
- Edit the release
- Check "This is a pre-release"
-
Delete Release (if needed)
- Delete release from GitHub
- Delete tag:
git push --delete origin v1.0.0 - Delete local tag:
git tag -d v1.0.0
-
Create Fixed Release
- Fix the issue
- Create new release with patch version
Problem: Build fails in GitHub Actions
Solutions:
- Check Go version compatibility
- Verify all dependencies available
- Check build logs for errors
- Test build locally first
Problem: Docker image push fails
Solutions:
- Verify Docker Hub credentials in secrets
- Check Docker Hub repository exists
- Verify repository permissions
Problem: Users report install.sh can't download binary
Solutions:
- Verify release artifacts uploaded correctly
- Check GitHub API rate limits
- Verify binary names match expected format
- Check network connectivity
If GitHub Actions fails, create release manually:
-
Build Binaries Locally
# Linux AMD64 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o defenra-agent-linux-amd64 . tar -czf defenra-agent-linux-amd64.tar.gz defenra-agent-linux-amd64 sha256sum defenra-agent-linux-amd64.tar.gz > defenra-agent-linux-amd64.tar.gz.sha256 # Repeat for other platforms
-
Create GitHub Release
- Go to: https://github.com/Defenra/DefenraAgent/releases/new
- Enter tag version
- Add release notes
- Upload artifacts
- Publish release
Future enhancement: Sign release artifacts with GPG
gpg --detach-sign --armor defenra-agent-linux-amd64.tar.gzUsers should verify checksums:
sha256sum -c defenra-agent-linux-amd64.tar.gz.sha256The install.sh script automatically verifies checksums.
For release-related questions:
- GitHub Issues: https://github.com/Defenra/DefenraAgent/issues
- Email: support@defenra.com
Last Updated: 2025-10-23