Skip to content

Commit aa9e329

Browse files
committed
test: add goreleaser
1 parent 374f6ef commit aa9e329

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
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: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
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@v4
22+
with:
23+
go-version: '^1.21.3'
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v5
27+
with:
28+
distribution: goreleaser
29+
version: latest
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ go.work
2323

2424
# Editor
2525
.vscode/
26+
27+
dist/

.goreleaser.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
version: 1
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
goos:
13+
- linux
14+
- windows
15+
- darwin
16+
17+
archives:
18+
- format: tar.gz
19+
name_template: >-
20+
{{ .ProjectName }}_
21+
{{- title .Os }}_
22+
{{- if eq .Arch "amd64" }}x86_64
23+
{{- else if eq .Arch "386" }}i386
24+
{{- else }}{{ .Arch }}{{ end }}
25+
{{- if .Arm }}v{{ .Arm }}{{ end }}
26+
format_overrides:
27+
- goos: windows
28+
format: zip
29+
30+
changelog:
31+
sort: asc
32+
filters:
33+
exclude:
34+
- "^docs:"
35+
- "^test:"

0 commit comments

Comments
 (0)