Skip to content
/ golang-template Public template

Template used to bootstrap GitHub Golang projects at Criteo

License

Notifications You must be signed in to change notification settings

criteo/golang-template

Repository files navigation

Go status CI GitHub

Criteo Golang template

This repository contains the template used to bootstrap GitHub Golang projects at Criteo.

How to bootstrap your own repository

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

Continuous Integration

Tests are run automatically on Pull Requests and Push events:

Releases

  • Prerequisite: For github projects under Criteo organisation, make sure to have cloned your project in ssh mode, else you will get a 403 when pushing tags.

  • 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 tag          # 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.

About

Template used to bootstrap GitHub Golang projects at Criteo

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •