This document explains how to create new releases for pctl using GoReleaser and automated GitHub Actions.
To create a new release, simply run:
./scripts/release.sh 1.1.1This will:
- Create a git tag
v1.1.1 - Push the tag to GitHub
- Trigger the automated GoReleaser workflow
- Build binaries for all platforms
- Create a GitHub release with all binaries and release notes
- You must be on the
mainormasterbranch - Your working directory must be clean (no uncommitted changes)
- You must have push access to the repository
The automated release process uses GoReleaser and includes:
GoReleaser builds binaries for multiple platforms:
- Linux AMD64 (
pctl_linux_amd64) - Linux ARM64 (
pctl_linux_arm64) - macOS AMD64 (
pctl_darwin_amd64) - macOS ARM64 (
pctl_darwin_arm64) - Windows AMD64 (
pctl_windows_amd64.exe)
- Creates a GitHub release with the tag name
- Generates automatic release notes from git commits
- Uploads all built binaries and archives
- Creates and uploads SHA256 checksums
GoReleaser automatically generates release notes including:
- List of commits since the last release
- Installation instructions for all platforms
- Link to the full changelog
If you prefer to create releases manually:
-
Create and push a tag:
git tag -a v1.1.1 -m "Release 1.1.1" git push origin v1.1.1 -
Monitor the workflow:
- Go to the Actions tab
- Watch the "Release" workflow run
- The release will be created automatically when the workflow completes
Follow Semantic Versioning:
- MAJOR (1.0.0): Breaking changes
- MINOR (1.1.0): New features, backward compatible
- PATCH (1.1.1): Bug fixes, backward compatible
For pre-releases, use suffixes:
1.1.1-beta.11.1.1-rc.11.1.1-alpha.1
The release script supports several options:
# Create a release
./scripts/release.sh 1.1.1
# Dry run (see what would happen)
./scripts/release.sh 1.1.1 --dry-run
# Pre-release
./scripts/release.sh 1.1.1-beta.1
# Show help
./scripts/release.sh --helpIf you get "Tag already exists", you can:
- Delete the local tag:
git tag -d v1.1.1 - Delete the remote tag:
git push origin --delete v1.1.1 - Or use a different version number
If the GitHub Actions workflow fails:
- Check the Actions tab for error details
- Common issues:
- Build failures (check Go version compatibility)
- Permission issues (check repository settings)
- Network issues (retry the workflow)
If the automated process fails, you can create a release manually:
- Go to Releases
- Click "Create a new release"
- Select the tag
- Add release notes
- Upload the binaries from your local
build/directory
After a successful release, the following files will be available:
pctl-{version}-linux-amd64pctl-{version}-linux-arm64pctl-{version}-darwin-amd64pctl-{version}-darwin-arm64pctl-{version}-windows-amd64.exechecksums.txt(SHA256 checksums for all binaries)