If you haven't already go and initialize your module:
# This assumes you have your package located at ~/go/src/github.com/your_account/your_package
go mod init github.com/your_account/your_package
go mod tidy
This will create the following files:
go.sum
go.mod
If you have a remote then is best to commit this and push it:
git add go.mod go.sum
git commit -m "Initialize Go Module."
git push
You can tag your package version using the git tag
command:
git tag -a v1.0.0 -m "Version 1.0.0"
To see your tag information:
# Just the Tags
git tag -n
# More detailed info
git show v1.0.0
Push the tag to ORIGIN:
git push origin v1.0.0
If you want to undo your tag for some reason:
git tag -d v1.0.0
git push --delete origin v1.0.0
It's recommended that you put a badge in your README.md to let users know what's the latest release:
[![Release](https://img.shields.io/github/v/tag/your_user/your_repo?label=Release&sort=semver)](https://github.com/your_user/your_repo/releases/latest)
First go to proxy.golang.org and fech your new version info:
https://proxy.golang.org/github.com/your_user/your_repo/@v/v1.0.0.info
Then check that the documentation was refreshed. If not, try to load the specific version and a Resquest
button will be provided for you to do a manual fetch:
https://pkg.go.dev/github.com/your_user/your_repo/@v1.0.0