Skip to content

Commit 6ae4a2d

Browse files
committed
github: add goreleaser
1 parent 4df38c8 commit 6ae4a2d

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

.github/workflows/release.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@ name: release
22
on:
33
release:
44
types:
5-
- published
6-
5+
- created
76
jobs:
8-
release:
7+
goreleaser:
98
runs-on: ubuntu-latest
109
steps:
11-
- uses: actions/checkout@v3
12-
- name: Build and copy binary
13-
run: make build-docker
14-
- name: Upload binary to release
15-
uses: softprops/action-gh-release@v1
16-
if: ${{startsWith(github.ref, 'refs/tags/') }}
10+
-
11+
name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
-
16+
name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: 1.23.1
20+
-
21+
name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v6
1723
with:
18-
files: ./bin/efes
24+
version: '~> v2'
25+
args: release --clean
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod download
6+
7+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
main: main.go
11+
goos:
12+
- linux
13+
goarch:
14+
- amd64
15+
archives:
16+
- format: tar.gz
17+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
18+
checksum:
19+
name_template: 'checksums.txt'
20+
snapshot:
21+
version_template: "{{ .Tag }}-next"
22+
changelog:
23+
sort: asc
24+
filters:
25+
exclude:
26+
- '^docs:'
27+
- '^test:'

0 commit comments

Comments
 (0)