Skip to content

Commit

Permalink
ci: refactor goreleaser configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hughes committed Mar 9, 2022
1 parent b967dd3 commit 24d2c94
Showing 1 changed file with 41 additions and 29 deletions.
70 changes: 41 additions & 29 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
project_name: siftool

release:
github:
owner: sylabs
name: sif
prerelease: auto

changelog:
use: github-native

gomod:
proxy: true
env:
- GOPROXY=https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org

builds:
- binary: siftool
- id: darwin-builds
binary: siftool
goos:
- darwin
goarch:
- amd64
- arm64
main: &build-main ./cmd/siftool
mod_timestamp: &build-timestamp '{{ .CommitTimestamp }}'
env: &build-env
- CGO_ENABLED=0
flags: &build-flags '-trimpath'
ldflags: &build-ldflags |
-s
-w
-X main.version={{ .Version }}
-X main.date={{ .CommitDate }}
-X main.builtBy=goreleaser
-X main.commit={{ .FullCommit }}

- id: linux-builds
binary: siftool
goos:
- linux
goarch:
- amd64
Expand All @@ -18,29 +42,17 @@ builds:
goarm:
- '6'
- '7'
env:
- CGO_ENABLED=0
flags: '-trimpath'
ldflags: '-s -w -X main.version={{ .Version }} -X main.commit={{ .FullCommit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser'
main: ./cmd/siftool
mod_timestamp: '{{ .CommitTimestamp }}'
main: *build-main
mod_timestamp: *build-timestamp
env: *build-env
flags: *build-flags
ldflags: *build-ldflags

archives:
- format: tar.gz
wrap_in_directory: 'true'
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- README.md

checksum:
name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'
- id: darwin-archives
builds:
- darwin-builds

changelog:
sort: asc
filters:
exclude:
- '^dev:'
- '^docs:'
- '^test:'
- '^Merge branch'
- '^Merge pull request'
- id: linux-archives
builds:
- linux-builds

0 comments on commit 24d2c94

Please sign in to comment.