Skip to content

Commit 6cd984d

Browse files
authored
ci: automate releases (#37)
Automate releases using goreleaser to minimise developer work. Also: * Update dependencies to address dependabot alert in gopkg.in/yaml.v2.
1 parent e3d7149 commit 6cd984d

File tree

4 files changed

+93
-6
lines changed

4 files changed

+93
-6
lines changed

.github/workflows/release-build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
name: Release Go Binary
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- name: Set up Go
21+
uses: actions/setup-go@v3
22+
with:
23+
go-version: 1.19
24+
cache: true
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v3
27+
with:
28+
# either 'goreleaser' (default) or 'goreleaser-pro'
29+
distribution: goreleaser
30+
version: latest
31+
args: release --rm-dist
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
35+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# When adding options check the documentation at https://goreleaser.com
2+
builds:
3+
- skip: true
4+
release:
5+
header: |
6+
<a name='{{.Tag}}'></a>
7+
### {{.Tag}} Release Notes ({{.Date}})
8+
footer: |
9+
[Full Changelog](https://{{ .ModulePath }}/compare/{{ .PreviousTag }}...{{ .Tag }})
10+
changelog:
11+
use: github
12+
sort: asc
13+
filters:
14+
exclude:
15+
- Merge pull request
16+
- Merge remote-tracking branch
17+
- Merge branch
18+
19+
# Group commits messages by given regex and title.
20+
# Order value defines the order of the groups.
21+
# Proving no regex means all commits will be grouped under the default group.
22+
# Groups are disabled when using github-native, as it already groups things by itself.
23+
# Matches are performed against strings of the form: "<abbrev-commit>[:] <title-commit>".
24+
#
25+
# Default is no groups.
26+
groups:
27+
- title: Features
28+
regexp: '^.*?(feat|feature)(\([[:word:]]+\))??!?:.+$'
29+
order: 0
30+
- title: 'Bug fixes'
31+
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
32+
order: 1
33+
- title: 'Chores'
34+
regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
35+
order: 2
36+
- title: 'Quality'
37+
regexp: '^.*?(qa|test|tests)(\([[:word:]]+\))??!?:.+$'
38+
order: 3
39+
- title: 'Documentation'
40+
regexp: '^.*?(doc|docs)(\([[:word:]]+\))??!?:.+$'
41+
order: 4
42+
- title: 'Continuous Integration'
43+
regexp: '^.*?ci(\([[:word:]]+\))??!?:.+$'
44+
order: 5
45+
- title: Other
46+
order: 999

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ go 1.13
44

55
require (
66
github.com/mitchellh/mapstructure v1.5.0
7-
github.com/stretchr/testify v1.4.0
7+
github.com/stretchr/testify v1.8.1
88
golang.org/x/crypto v0.3.0
99
)

go.sum

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
21
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
34
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
45
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
56
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
67
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
78
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
8-
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
9-
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
9+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
10+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
11+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
12+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
13+
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
14+
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
1015
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
1116
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
1217
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
@@ -40,5 +45,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
4045
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
4146
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4247
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
43-
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
44-
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
48+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
49+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
50+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)