Skip to content

Commit f311c28

Browse files
committed
ci(release): add GoReleaser and release-please config for semantic versioning
- Add .goreleaser.yml for cross-platform binary builds - Add release-please-config.json and manifest at v0.5.0 - Fix workflow: add tag ref checkout to prevent SHA mismatch with rebase-and-merge - Fix workflow: add contents:write permission to goreleaser job
1 parent ac1a0d0 commit f311c28

4 files changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ jobs:
2525
needs: release-please
2626
if: ${{ needs.release-please.outputs.release_created }}
2727
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
2830
steps:
2931
- uses: actions/checkout@v4
3032
with:
3133
fetch-depth: 0
34+
ref: ${{ needs.release-please.outputs.tag_name }}
3235

3336
- uses: actions/setup-go@v5
3437
with:

.goreleaser.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 2
2+
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- linux
8+
- darwin
9+
- windows
10+
goarch:
11+
- amd64
12+
- arm64
13+
ldflags:
14+
- -s -w -X main.version={{.Version}}
15+
16+
archives:
17+
- format: tar.gz
18+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
19+
format_overrides:
20+
- goos: windows
21+
format: zip
22+
23+
changelog:
24+
sort: asc
25+
filters:
26+
exclude:
27+
- "^docs:"
28+
- "^test:"
29+
- "^chore\\(deps\\):"
30+
groups:
31+
- title: "Breaking Changes"
32+
regexp: '^.*?!:.+$'
33+
order: 0
34+
- title: "Features"
35+
regexp: '^feat.*'
36+
order: 1
37+
- title: "Bug Fixes"
38+
regexp: '^fix.*'
39+
order: 2
40+
- title: "Performance"
41+
regexp: '^perf.*'
42+
order: 3
43+
- title: "Other"
44+
order: 999
45+
46+
release:
47+
github:
48+
owner: zerfoo
49+
name: zonnx
50+
prerelease: auto
51+
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.5.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)