This document describes how to create a new release for go-pivnet.
-
Install goreleaser:
brew install goreleaser # or go install github.com/goreleaser/goreleaser@latest -
Ensure you have a GitHub token with appropriate permissions set:
export GITHUB_TOKEN=your_github_token
Create a new tag following semantic versioning (e.g., v7.1.0):
# Create an annotated tag
git tag -a v7.1.0 -m "Release v7.1.0"
# Push the tag to GitHub
git push origin v7.1.0Or create a tag from the GitHub UI when creating a release.
Run goreleaser to create the release:
goreleaser releaseThis will:
- Generate a changelog from git commits
- Create a draft GitHub release
- Upload any build artifacts (if builds are configured)
- Go to the GitHub releases page
- Review the draft release
- Edit the release notes if needed
- Click "Publish release" when ready
To test the release process without actually creating a release:
goreleaser release --snapshotThis creates a snapshot release that won't be published to GitHub.
What happens with --snapshot:
- Creates local artifacts in the
dist/folder - Does NOT create a GitHub release
- Useful for testing the release process locally
To check snapshot results:
- Look in the
dist/folder for generated files - Check
dist/metadata.jsonfor release metadata - Since builds are skipped for this library, the folder will mainly contain metadata files
To create an actual release on GitHub:
- Run
goreleaser release(without--snapshot) - Then check: https://github.com/pivotal-cf/go-pivnet/releases
- The release will appear as a draft that you can review and publish
- Releases are created as drafts by default, so you can review before publishing
- The changelog automatically excludes commits starting with
docs:,test:, andchore: - Make sure your git tags follow semantic versioning (e.g.,
v7.1.0,v7.2.0)