AgentSkillsCN

Releasing Software

软件发布

SKILL.md
<!-- ABOUTME: Release preparation skill - prevents retag-four-times pattern --> <!-- ABOUTME: Invoked on "release", "tag", "ship it", "push to production" -->

name: releasing-software description: "Release prep and tagging with pre-flight verification. Use when user says release, tag, ship it, push to production, create release, or bump version."

Releasing Software

Iron Law

NO TAG WITHOUT GREEN CI

Run full verification locally → Fix everything → THEN tag. Never tag before CI passes.

Pre-Release Checklist

CheckItemsWhy
Build Pathsgoreleaser.yml main:, workflows, Makefile, DockerfileWrong path = build failure
Test CoverageEvery package has ≥1 test fileGo 1.23+ covdata fails without tests
Local CImake test && make lint && make buildCatch failures before push
DocsREADME.md, CHANGELOG.md, version refsProfessional releases
Release Configgoreleaser description, homepage URL, .gitignoreProper artifact generation
Git Stategit status, git diff --stat, git logClean history

Release Procedure

Only after ALL checks pass:

  1. Commit: git add -A && git commit -m "release: prepare vX.Y.Z"
  2. Wait for pre-commit hooks
  3. Push and WAIT: git push origin main
  4. Check CI: gh run list --limit 2
  5. Only after green: git tag -a vX.Y.Z -m "vX.Y.Z" && git push origin vX.Y.Z
  6. Verify release workflow triggered

Red Flags - STOP IMMEDIATELY

  • Tagging before CI completes
  • "CI will probably pass"
  • Deleting/recreating tags
  • Force-pushing tags

Common Failures

SymptomRoot CauseFix
"couldn't find main file"Wrong goreleaser pathSet main: . if main.go at root
"no such tool 'covdata'"Package without testsAdd _test.go with placeholder
Had to retagTagged before CI passedWAIT FOR GREEN CI
Build fails but tests passWrong build pathCheck Makefile/goreleaser match

Semver Quick Ref

  • Patch (0.0.X): Bug fixes only
  • Minor (0.X.0): New features, backwards compatible
  • Major (X.0.0): Breaking changes

Troubleshooting

bash
# Verify goreleaser config
goreleaser check

# Dry run release
goreleaser release --snapshot --clean

# Check for packages without tests
find . -type d -not -path "*/.*" -exec sh -c 'ls {}/*_test.go 2>/dev/null || echo "No tests: {}"' \;

Remember

Every retag erodes trust. Fix problems before tagging, not after.