Skip to content

Commit 1cda733

Browse files
authored
Introduce goreleaser to make the release of a new version easier (#173)
1 parent 08ff0c0 commit 1cda733

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: "1.23"
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
27+
with:
28+
distribution: goreleaser
29+
version: "~> v2"
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/coverage.txt
1+
/coverage.txt
2+
dist/

.goreleaser.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
version: 2
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- skip: true
11+
12+
changelog:
13+
use: github
14+
sort: asc
15+
filters:
16+
exclude:
17+
- "^docs:"
18+
- "^test:"
19+
20+
release:
21+
name_template: "v{{ .Version }}"
22+
footer: |
23+
**Full Changelog**: https://github.com/andygrunwald/go-gerrit/compare/{{ .PreviousTag }}...{{ if .IsNightly }}nightly{{ else }}{{ .Tag }}{{ end }}

0 commit comments

Comments
 (0)