diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dc7c46..d89f93a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,16 +27,8 @@ jobs: working_directory: /go/src/github.com/jimeh/casecmp steps: - checkout - - run: - name: Install tools - command: | - go get github.com/goreleaser/goreleaser - - run: - name: Install dependencies - command: go mod download - - run: - name: Run goreleaser - command: goreleaser + - run: curl -sL https://git.io/goreleaser | bash + workflows: version: 2 build: diff --git a/.gitignore b/.gitignore index cc103cb..13fcba3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ bin/* dist/* releases/* +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml index c27c306..a53595b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,10 +1,14 @@ -project_name: casecmp +before: + hooks: + - go mod tidy builds: - - main: main.go - binary: casecmp - flags: -a - env: + - env: - CGO_ENABLED=0 + mod_timestamp: "{{ .CommitTimestamp }}" + flags: + - -trimpath + ldflags: + - "-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }}" goos: - darwin - freebsd @@ -17,18 +21,29 @@ builds: goarm: - 6 - 7 -archive: - name_template: '{{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm - }}v{{ .Arm }}{{ end }}' - format: tar.gz - wrap_in_directory: true - format_overrides: - - goos: windows - format: zip -before: - hooks: - - make clean -git: - short_hash: true + +archives: + - format: tar.gz + name_template: |- + {{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }} + wrap_in_directory: true + format_overrides: + - goos: windows + format: zip + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + +checksum: + name_template: "checksums.txt" snapshot: - name_template: snapshot-{{.Commit}} + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"