Skip to content

Commit 4d68ca7

Browse files
committed
add goreleaser
1 parent 8aa4503 commit 4d68ca7

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/release.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release Go project
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: GoReleaser build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: stable
26+
id: go
27+
28+
- name: Run GoReleaser
29+
uses: goreleaser/goreleaser-action@v6
30+
with:
31+
distribution: goreleaser
32+
version: "~> v1"
33+
args: release --clean
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
project_name: varnishlog-parser
3+
before:
4+
hooks:
5+
- go mod tidy
6+
builds:
7+
- env:
8+
- CGO_ENABLED=0
9+
goos:
10+
- linux
11+
- darwin
12+
ldflags:
13+
- -X github.com/aorith/varnishlog-parser/cmd.Version={{.Version}}
14+
archives:
15+
- format: tar.gz
16+
id: varnishlog_parser
17+
name_template: >-
18+
{{ .ProjectName }}_
19+
{{- title .Os }}_
20+
{{- if eq .Arch "amd64" }}x86_64
21+
{{- else if eq .Arch "386" }}i386
22+
{{- else }}{{ .Arch }}{{ end }}
23+
{{- if .Arm }}v{{ .Arm }}{{ end }}
24+
changelog:
25+
use: github
26+
sort: asc

0 commit comments

Comments
 (0)