Skip to content

Commit 24d2c94

Browse files
author
Adam Hughes
committed
ci: refactor goreleaser configuration
1 parent b967dd3 commit 24d2c94

File tree

1 file changed

+41
-29
lines changed

1 file changed

+41
-29
lines changed

.goreleaser.yml

+41-29
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1-
project_name: siftool
2-
31
release:
4-
github:
5-
owner: sylabs
6-
name: sif
72
prerelease: auto
83

4+
changelog:
5+
use: github-native
6+
7+
gomod:
8+
proxy: true
9+
env:
10+
- GOPROXY=https://proxy.golang.org,direct
11+
- GOSUMDB=sum.golang.org
12+
913
builds:
10-
- binary: siftool
14+
- id: darwin-builds
15+
binary: siftool
1116
goos:
1217
- darwin
18+
goarch:
19+
- amd64
20+
- arm64
21+
main: &build-main ./cmd/siftool
22+
mod_timestamp: &build-timestamp '{{ .CommitTimestamp }}'
23+
env: &build-env
24+
- CGO_ENABLED=0
25+
flags: &build-flags '-trimpath'
26+
ldflags: &build-ldflags |
27+
-s
28+
-w
29+
-X main.version={{ .Version }}
30+
-X main.date={{ .CommitDate }}
31+
-X main.builtBy=goreleaser
32+
-X main.commit={{ .FullCommit }}
33+
34+
- id: linux-builds
35+
binary: siftool
36+
goos:
1337
- linux
1438
goarch:
1539
- amd64
@@ -18,29 +42,17 @@ builds:
1842
goarm:
1943
- '6'
2044
- '7'
21-
env:
22-
- CGO_ENABLED=0
23-
flags: '-trimpath'
24-
ldflags: '-s -w -X main.version={{ .Version }} -X main.commit={{ .FullCommit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser'
25-
main: ./cmd/siftool
26-
mod_timestamp: '{{ .CommitTimestamp }}'
45+
main: *build-main
46+
mod_timestamp: *build-timestamp
47+
env: *build-env
48+
flags: *build-flags
49+
ldflags: *build-ldflags
2750

2851
archives:
29-
- format: tar.gz
30-
wrap_in_directory: 'true'
31-
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
32-
files:
33-
- README.md
34-
35-
checksum:
36-
name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'
52+
- id: darwin-archives
53+
builds:
54+
- darwin-builds
3755

38-
changelog:
39-
sort: asc
40-
filters:
41-
exclude:
42-
- '^dev:'
43-
- '^docs:'
44-
- '^test:'
45-
- '^Merge branch'
46-
- '^Merge pull request'
56+
- id: linux-archives
57+
builds:
58+
- linux-builds

0 commit comments

Comments
 (0)