Skip to content

Commit 668ec0f

Browse files
committed
add goreleaser
Signed-off-by: darox <[email protected]>
1 parent f864388 commit 668ec0f

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
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@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.23'
23+
- name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v4
25+
with:
26+
distribution: goreleaser
27+
version: latest
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
k8s-iperf
1+
k8s-iperf
2+
.DS_Store
3+
dist

.goreleaser.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
builds:
2+
- main: ./cmd/main.go
3+
env:
4+
- CGO_ENABLED=0
5+
goos:
6+
- linux
7+
- darwin
8+
goarch:
9+
- amd64
10+
- arm64
11+
flags:
12+
- -trimpath
13+
ldflags:
14+
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
15+
archives:
16+
- name_template: >-
17+
{{ .ProjectName }}_
18+
{{- title .Os }}_
19+
{{- if eq .Arch "amd64" }}x86_64
20+
{{- else }}{{ .Arch }}{{ end }}
21+
checksum:
22+
name_template: 'checksums.txt'
23+
snapshot:
24+
name_template: "{{ .Tag }}-next"
25+
changelog:
26+
sort: asc
27+
filters:
28+
exclude:
29+
- '^docs:'
30+
- '^test:'

0 commit comments

Comments
 (0)