Skip to content

Commit

Permalink
ci: add goreleaser, update action and go versions (#662)
Browse files Browse the repository at this point in the history
Add goreleaser to automate the generation of release notes and bump
the versions of github actions golang go the latest versions.
  • Loading branch information
stevenh committed Feb 20, 2024
1 parent 1d393b3 commit 1bfd3c1
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
matrix:
go-version:
- '1.20'
- '1.21'
- '1.22'
os:
- 'ubuntu-latest'
redis:
Expand All @@ -37,4 +37,4 @@ jobs:
uses: actions/checkout@v4

- name: Go Test
run: go test ./...
run: go test -race ./...
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup golang
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.22'
cache: false # Handled by golangci-lint.

- name: Validate go mod
Expand All @@ -26,7 +26,7 @@ jobs:
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.55.2
version: v1.56.2
args: --out-format=colored-line-number
32 changes: 32 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

permissions:
contents: write

jobs:
goreleaser:
name: Release Go Binary
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# When adding options check the documentation at https://goreleaser.com
builds:
- skip: true
release:
header: |
<a name='{{.Tag}}'></a>
### {{.Tag}} Release Notes ({{.Date}})
footer: |
[Full Changelog](https://{{ .ModulePath }}/compare/{{ .PreviousTag }}...{{ .Tag }})
changelog:
use: github
sort: asc
filters:
exclude:
- Merge pull request
- Merge remote-tracking branch
- Merge branch

# Group commits messages by given regex and title.
# Order value defines the order of the groups.
# Proving no regex means all commits will be grouped under the default group.
# Groups are disabled when using github-native, as it already groups things by itself.
# Matches are performed against strings of the form: "<abbrev-commit>[:] <title-commit>".
#
# Default is no groups.
groups:
- title: Features
regexp: '^.*?(feat|feature)(\([[:word:]]+\))??!?:.+$'
order: 0
- title: 'Bug fixes'
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: 'Chores'
regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
order: 2
- title: 'Quality'
regexp: '^.*?(qa|test|tests)(\([[:word:]]+\))??!?:.+$'
order: 3
- title: 'Documentation'
regexp: '^.*?(doc|docs)(\([[:word:]]+\))??!?:.+$'
order: 4
- title: 'Continuous Integration'
regexp: '^.*?ci(\([[:word:]]+\))??!?:.+$'
order: 5
- title: Other
order: 999

0 comments on commit 1bfd3c1

Please sign in to comment.