2.3 KiB
2.3 KiB
Releasing go-lib/micro
This document describes the process for creating a release of the
go-lib/micro library.
Overview
Releases in this project are managed via Git tags. When you push a
tag matching the pattern v* (for example, v0.2.0), the Drone
pipeline automatically:
- Runs quality checks (tests, coverage gate, vet, vulnerability scan)
- Generates release notes from commits
- Creates a source archive (
sources.tar.gz) - Publishes a release to Gitea with attached artifacts
Versioning
This library follows semantic versioning: MAJOR.MINOR.PATCH
(for example, v1.2.3).
v1.0.0: breaking API changesv1.1.0: backward-compatible featuresv1.0.1: backward-compatible fixes
Prerequisites
Before creating a release, ensure:
- Working tree is clean (
git status) - Tests pass locally (
go test ./...) - Coverage is at least 80%
- Dependencies are tidy (
go mod tidy) - Documentation is up to date (README/docs)
Create a Release
1. Prepare (optional)
Update docs, examples, or changelog if needed:
git add README.md docs/
git commit -m "docs: prepare release"
2. Create tag
git tag -a v0.2.0 -m "Release v0.2.0"
3. Push tag
git push origin v0.2.0
4. Verify pipeline and release
After pushing the tag, verify in Drone and Gitea:
- Pipeline succeeded for tag build
- Gitea release exists with artifacts:
.build/coverage.txt.build/sources.tar.gz.build/release-notes.md
Install Released Version
# latest
go get scm.yoorie.de/go-lib/micro
# specific
go get scm.yoorie.de/go-lib/micro@v0.2.0
Troubleshooting
Coverage below threshold
Run locally and inspect uncovered code:
go test -v -coverprofile .build/coverage.out ./...
go tool cover -func .build/coverage.out
Release step fails
Common causes:
- Missing Drone secret
gitea_token - Tag does not match
v* - Earlier pipeline step failed
Wrong tag pushed
git tag -d v0.2.0
git push origin :refs/tags/v0.2.0
Then create and push the corrected tag.
Release Checklist
- Tests pass locally
- Coverage is at least 80%
go vet ./...passesgovulncheck ./...is clean or reviewed- Tag
vX.Y.Zcreated and pushed - Drone pipeline succeeded
- Gitea release contains expected artifacts