fix(release): fix goreleaser setup

This commit is contained in:
2021-04-14 20:12:23 +01:00
parent e83e324867
commit eaf738c49f
3 changed files with 37 additions and 29 deletions

View File

@@ -27,16 +27,8 @@ jobs:
working_directory: /go/src/github.com/jimeh/casecmp working_directory: /go/src/github.com/jimeh/casecmp
steps: steps:
- checkout - checkout
- run: - run: curl -sL https://git.io/goreleaser | bash
name: Install tools
command: |
go get github.com/goreleaser/goreleaser
- run:
name: Install dependencies
command: go mod download
- run:
name: Run goreleaser
command: goreleaser
workflows: workflows:
version: 2 version: 2
build: build:

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
bin/* bin/*
dist/* dist/*
releases/* releases/*
dist/

View File

@@ -1,10 +1,14 @@
project_name: casecmp before:
hooks:
- go mod tidy
builds: builds:
- main: main.go - env:
binary: casecmp
flags: -a
env:
- CGO_ENABLED=0 - CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }}"
goos: goos:
- darwin - darwin
- freebsd - freebsd
@@ -17,18 +21,29 @@ builds:
goarm: goarm:
- 6 - 6
- 7 - 7
archive:
name_template: '{{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm archives:
}}v{{ .Arm }}{{ end }}' - format: tar.gz
format: tar.gz name_template: |-
wrap_in_directory: true {{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}
format_overrides: wrap_in_directory: true
- goos: windows format_overrides:
format: zip - goos: windows
before: format: zip
hooks: replacements:
- make clean darwin: Darwin
git: linux: Linux
short_hash: true windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: "checksums.txt"
snapshot: snapshot:
name_template: snapshot-{{.Commit}} name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"