This repository contains the template used to bootstrap GitHub Golang projects at Criteo.
Rename the Go module, and clean the example code:
go mod edit -module <github.com/your-org/your-awesome-project>
rm cmd/example -rf
Set the build details in .goreleaser.yaml
:
- id: example
binary: example
main: ./cmd/example
env:
- CGO_ENABLED=0
goos:
- linux
Tests are run automatically on Pull Requests and Push events:
- golangci-lint
go test
go build
- commitlint/config-conventional
- Step 1: push your changes
git add main.go
git commit "feat: adding an awesome feature"
git push
- Step 2: merge the related PR from the GitHub web UI
- Step 3: add a new tag
git tags # get the list of existing tags
git tag v0.0.2 # create a tag on the current local HEAD
git push --tags # push only the tag to GitHub
You are encouraged to use Semantic Versioning.
Once the tag is pushed, GitHub action will run GoReleaser automatically. GoReleaser will publish a new release with an auto-generated changelog using the commits message.