| name | release | ||
|---|---|---|---|
| description | Guide releasing a new grafanactl version. Use when user wants to create a release, tag a version, or asks about the release process. | ||
| allowed-tools |
|
Automates the grafanactl release process using scripts/release.sh and svu for semantic versioning.
- User asks to "release a new version" or "create a release"
- User says "tag v0.x.y" or "bump version"
- User mentions "publish a release"
- Questions about the release process
Check the current version and what versions are available:
# Run in parallel
svu current
svu next
svu patch
svu minor
svu majorShow commits since the last tag:
git log $(svu current)..HEAD --onelinePresent the options to the user:
next- Auto-detect based on conventional commits (recommended)patch- Bug fixes only (0.1.8 → 0.1.9)minor- New features (0.1.8 → 0.2.0)major- Breaking changes (0.1.8 → 1.0.0)
The scripts/release.sh script handles everything:
scripts/release.sh <bump-type>The script will:
- Calculate the next version using
svu - Show commits since last tag
- Run
make all(lint, tests, build, docs) - Ask for confirmation
- Create and push the git tag
- Print GitHub Actions workflow URL
Note: The script is interactive and requires user confirmation before pushing the tag.
After the tag is pushed, monitor the GitHub Actions workflow:
# Check latest release workflow run
gh run list --workflow=release.yaml --limit=1
# Watch the run in progress (optional)
gh run watchThe workflow performs:
- GoReleaser builds (linux/darwin/windows, multiple architectures)
- Documentation build
- GitHub Pages deployment
- Changelog generation (auto-excludes
docs:,test:,chore:commits)
Once the workflow completes:
# View the release
gh release view <version>
# Get release URL
echo "https://github.com/$(gh repo view --json nameWithOwner -q .nameWithOwner)/releases/tag/<version>"Before running the release script, ensure:
- ✅ All changes committed and pushed to main
- ✅ CI passing on main branch
- ✅ No uncommitted changes:
git status - ✅ Up to date with remote:
git pull - ✅ All PRs for this release are merged
The release script will also run make all which includes:
- Linting (
make lint) - Tests (
make tests) - Build (
make build) - Documentation generation (
make docs) - Documentation drift check (
make reference-drift)
# Show what version will be tagged
svu next
# Run release with auto-detection
scripts/release.sh next# Force a patch bump
scripts/release.sh patch# Show current and next versions
svu current
svu next
# Review commits
git log $(svu current)..HEAD --onelineThe svu tool uses conventional commits to determine version bumps:
| Commit Prefix | Version Bump | Example |
|---|---|---|
fix: |
Patch | 0.1.8 → 0.1.9 |
feat: |
Minor | 0.1.8 → 0.2.0 |
fix!: or feat!: |
Major | 0.1.8 → 1.0.0 |
BREAKING CHANGE: footer |
Major | 0.1.8 → 1.0.0 |
chore: |
None | No bump |
Solution: Install svu from https://github.com/caarlos0/svu or via:
go install github.com/caarlos0/svu@latestSolution: Fix the reported issues first:
- Linter errors: Run
make lintand fix - Test failures: Run
make testsand fix - Docs drift: Run
make docsto regenerate
Solution:
- Check existing tags:
git tag - Delete local tag if needed:
git tag -d <version> - Force-delete remote tag (CAUTION):
git push origin :refs/tags/<version>
Solution:
- View workflow logs:
gh run view <run-id> - Check for common issues:
- GoReleaser configuration errors
- Build failures
- Documentation build errors
- Fix and re-run if possible, or create a patch release
scripts/release.sh- Release automation script.goreleaser.yaml- GoReleaser configuration.github/workflows/release.yaml- Release workflowAGENTS.md- Release process documentation
- ✅ Use
nextfor automatic version detection - ✅ Review commits before releasing
- ✅ Wait for CI to pass before releasing
- ✅ Monitor the release workflow after pushing tag
- ✅ Verify the GitHub release page after completion
- ❌ Release with uncommitted changes
- ❌ Skip the pre-release checks (
make all) - ❌ Force-push release tags
- ❌ Delete released tags (breaks users)
- ❌ Release from non-main branches