From 5c61222e5cd493e38132e4c45ac0ebc29dcf9d21 Mon Sep 17 00:00:00 2001 From: Maxence Maireaux Date: Mon, 17 Apr 2023 11:28:20 +0200 Subject: [PATCH] feat: Improvement for GoReleaser --- .goreleaser-darwin.yml | 64 ---------------------------------------- .goreleaser.yml | 66 ++++++++++++++++++++++++++++++------------ 2 files changed, 47 insertions(+), 83 deletions(-) delete mode 100644 .goreleaser-darwin.yml diff --git a/.goreleaser-darwin.yml b/.goreleaser-darwin.yml deleted file mode 100644 index 01f6250e8..000000000 --- a/.goreleaser-darwin.yml +++ /dev/null @@ -1,64 +0,0 @@ -project_name: ledger -env: - - GO111MODULE=on - - GOPROXY=https://proxy.golang.org -before: - hooks: - - go mod download - -builds: - - binary: ledger - id: ledger_darwin - ldflags: - - -X github.com/ledger/ledger/cmd.BuildDate={{ .Date }} - - -X github.com/ledger/ledger/cmd.Version={{ .Version }} - - -X github.com/ledger/ledger/cmd.Commit={{ .ShortCommit }} - - -X github.com/ledger/ledger/cmd.DefaultSegmentWriteKey={{ .Env.SEGMENT_WRITE_KEY }} - - -s - env: - - CGO_ENABLED=1 - goos: - - darwin - goarch: - - amd64 - - arm64 - flags: - - -tags=json1 - -archives: - - id: "ledger" - builds: - - ledger_darwin - format: tar.gz - format_overrides: - - goos: windows - format: zip - name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}" - replacements: - amd64: 64bit - 386: 32bit - arm: ARM - arm64: ARM64 - darwin: macOS - linux: Linux - windows: Windows - - -checksum: - name_template: 'checksums-darwin.txt' - -snapshot: - name_template: "{{ .Tag }}" - -brews: - - tap: - owner: formancehq - name: homebrew-tap - name: ledger - folder: Formula - homepage: https://formance.com - skip_upload: auto - test: | - system "#{bin}/ledger version" - install: | - bin.install "ledger" diff --git a/.goreleaser.yml b/.goreleaser.yml index 60eb0b6f8..3e0df53c3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,16 +12,13 @@ builds: - -X github.com/ledger/ledger/cmd.Commit={{ .ShortCommit }} - -X github.com/ledger/ledger/cmd.DefaultSegmentWriteKey={{ .Env.SEGMENT_WRITE_KEY }} env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc + - CGO_ENABLED=0 goos: - windows goarch: - amd64 - flags: - - -tags=json1 - binary: ledger - id: ledger_linux_amd64 + id: ledger_linux ldflags: - -X github.com/ledger/ledger/cmd.BuildDate={{ .Date }} - -X github.com/ledger/ledger/cmd.Version={{ .Version }} @@ -29,37 +26,34 @@ builds: - -X github.com/ledger/ledger/cmd.DefaultSegmentWriteKey={{ .Env.SEGMENT_WRITE_KEY }} - -extldflags "-static" env: - - CGO_ENABLED=1 + - CGO_ENABLED=0 goos: - linux goarch: - amd64 - flags: - - -tags=json1,netgo + - arm64 - binary: ledger - id: ledger_linux_arm64 + id: ledger_darwin ldflags: - -X github.com/ledger/ledger/cmd.BuildDate={{ .Date }} - -X github.com/ledger/ledger/cmd.Version={{ .Version }} - -X github.com/ledger/ledger/cmd.Commit={{ .ShortCommit }} - -X github.com/ledger/ledger/cmd.DefaultSegmentWriteKey={{ .Env.SEGMENT_WRITE_KEY }} - - -extldflags "-static" + - -s env: - - CGO_ENABLED=1 - - CC=aarch64-linux-gnu-gcc + - CGO_ENABLED=0 goos: - - linux + - darwin goarch: + - amd64 - arm64 - flags: - - -tags=json1,netgo archives: - id: "ledger" builds: - - ledger_linux_amd64 - - ledger_linux_arm64 + - ledger_linux - ledger_windows + - ledger_darwin format: tar.gz format_overrides: - goos: windows @@ -74,13 +68,47 @@ archives: linux: Linux windows: Windows +checksum: + name_template: '{{.ProjectName}}_checksums.txt' + +snapshot: + name_template: "{{ .Tag }}" + +changelog: + sort: asc + use: github + filters: + exclude: + - '^docs:' + - '^test:' + - '^spec:' + - Merge pull request + - Merge remote-tracking branch + - Merge branch + - go mod tidy + groups: + - title: 'New Features' + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 10 + - title: Other work + order: 999 + +release: + prerelease: auto + footer: | + ## What to do next? + - Read the [documentation](https://docs.formance.com/) + - Join our [Slack server](https://formance.com/slack) + nfpms: - id: packages package_name: ledger file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" builds: - - ledger_linux_amd64 - - ledger_linux_arm64 + - ledger_linux homepage: https://formance.com maintainer: Maxence Maireaux formats: