Skip to content

Commit 7d5833c

Browse files
committed
update: goreleaser
1 parent 6b7e509 commit 7d5833c

File tree

2 files changed

+52
-8
lines changed

2 files changed

+52
-8
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
if: startsWith(github.ref, 'refs/tags/v') && github.ref_type == 'tag' && github.base_ref == 'main'
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: 1.24
23+
24+
- name: Install dependencies
25+
run: go mode download
26+
27+
- name: Run GoReleaser
28+
uses: goreleaser/goreleaser-action@v6
29+
with:
30+
distribution: goreleaser
31+
version: "lastest"
32+
args: release --snapshot --clean
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+

.goreleaser.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
project_name: ipvsdsc
2+
version: 2
13
before:
24
hooks:
35
- go mod download
46
builds:
5-
- goos:
7+
- id: ipvsdsc
8+
binary: ipvsdsc
9+
ldflags:
10+
- -s -w -X main.version=v{{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}}
11+
env:
12+
- CGO_ENABLED=0
13+
goos:
614
- linux
7-
archives:
8-
- replacements:
9-
linux: Linux
10-
386: i386
11-
amd64: x86_64
15+
goarch:
16+
- amd64
17+
- arm64
18+
mod_timestamp: '{{ .CommitTimestamp }}'
19+
1220
checksum:
13-
name_template: 'checksums.txt'
21+
name_template: "{{ .ProjectName }}-{{ .Version }}_checksums.txt"
22+
algorithm: sha512
1423
snapshot:
15-
name_template: "{{ .Tag }}-next"
24+
version_template: "{{ .Tag }}-next"
1625
changelog:
1726
sort: asc
1827
filters:

0 commit comments

Comments
 (0)