Skip to content

Commit 6c31d38

Browse files
committed
ci: add goreleaser
1 parent 1d37963 commit 6c31d38

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.github/workflows/goreleaser.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: stable
23+
- name: Build and Release
24+
uses: goreleaser/goreleaser-action@v6
25+
if: "startsWith(github.ref, 'refs/tags/v')"
26+
with:
27+
distribution: goreleaser
28+
version: "~> v2"
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Added by goreleaser init:
2+
dist/

.goreleaser.yaml

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

0 commit comments

Comments
 (0)