Skip to content

Commit ce68a2f

Browse files
committed
ci(release): add GoReleaser and release-please for semantic versioning
1 parent 3d43730 commit ce68a2f

4 files changed

Lines changed: 84 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,34 @@ permissions:
1212
jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
1518
steps:
1619
- uses: googleapis/release-please-action@v4
20+
id: release
1721
with:
1822
release-type: go
23+
24+
goreleaser:
25+
needs: release-please
26+
if: ${{ needs.release-please.outputs.release_created }}
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
ref: ${{ needs.release-please.outputs.tag_name }}
35+
36+
- uses: actions/setup-go@v5
37+
with:
38+
go-version-file: go.mod
39+
40+
- uses: goreleaser/goreleaser-action@v6
41+
with:
42+
version: "~> v2"
43+
args: release --clean
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
3+
builds:
4+
- skip: true
5+
6+
changelog:
7+
sort: asc
8+
filters:
9+
exclude:
10+
- "^docs:"
11+
- "^test:"
12+
- "^chore\\(deps\\):"
13+
groups:
14+
- title: "Breaking Changes"
15+
regexp: '^.*?!:.+$'
16+
order: 0
17+
- title: "Features"
18+
regexp: '^feat.*'
19+
order: 1
20+
- title: "Bug Fixes"
21+
regexp: '^fix.*'
22+
order: 2
23+
- title: "Performance"
24+
regexp: '^perf.*'
25+
order: 3
26+
- title: "Other"
27+
order: 999
28+
29+
release:
30+
github:
31+
owner: zerfoo
32+
name: float8
33+
prerelease: auto
34+
make_latest: true

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.3.0"
3+
}

release-please-config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "go",
5+
"bump-minor-pre-major": true,
6+
"bump-patch-for-minor-pre-major": true,
7+
"skip-github-release": true,
8+
"changelog-sections": [
9+
{ "type": "feat", "section": "Features" },
10+
{ "type": "fix", "section": "Bug Fixes" },
11+
{ "type": "perf", "section": "Performance" },
12+
{ "type": "refactor", "section": "Refactoring" },
13+
{ "type": "docs", "section": "Documentation", "hidden": true },
14+
{ "type": "test", "section": "Tests", "hidden": true },
15+
{ "type": "chore", "section": "Miscellaneous", "hidden": true }
16+
]
17+
}
18+
},
19+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
20+
}

0 commit comments

Comments
 (0)