Prerequisites:
- Install goreleaser:
go install github.com/goreleaser/goreleaser@latest
Steps:
-
Determine the release version:
- Identify the
MAJOR
,MINOR
, andPATCH
version numbers for the release. - For example:
MAJOR="1" MINOR="2" PATCH="3"
- Identify the
-
Create a release branch:
-
Create a release branch using the format
release-${MAJOR}.${MINOR}
:git checkout -b release-${MAJOR}.${MINOR}
-
Push the release branch to the upstream repository:
git push upstream release-${MAJOR}.${MINOR}
-
-
Create and push a tag:
-
Create a new tag using the format
v${MAJOR}.${MINOR}.${PATCH}
:git tag v${MAJOR}.${MINOR}.${PATCH}
-
Push the release branch to the upstream repository:
git push upstream v${MAJOR}.${MINOR}.${PATCH}
-
-
Build release artifacts:
-
Use
goreleaser
to build the release artifacts:goreleaser release --clean --skip-publish
This command generates the release artifacts in the
dist
directory.
-
-
Create a GitHub release:
- Go to the project's GitHub repository and navigate to the New Releases page.
- Select the newly created tag (
v${MAJOR}.${MINOR}.${PATCH}
) from the "Choose a tag" dropdown. - Attach the relevant release artifacts (
.tar.gz
and.zip
files) from thedist
directory. - Publish the release.