From 64d6fe669730ec91e7a7abd10275a40be524f820 Mon Sep 17 00:00:00 2001 From: Rodrigo Bernardi Date: Thu, 1 Aug 2024 23:29:14 -0300 Subject: [PATCH] fix: adjust build pipeline --- .github/workflows/release.yml | 12 ++----- .goreleaser.yaml | 51 +++++++++++++++++++++++++++++ .goreleaser.yml => .goreleaser2.yml | 0 3 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 .goreleaser.yaml rename .goreleaser.yml => .goreleaser2.yml (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e20064..2c6cd2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,15 +21,9 @@ jobs: id: go - name: Run GoReleaser - uses: goreleaser/goreleaser-action@master + uses: goreleaser/goreleaser-action@v6 with: - version: latest - args: release --rm-dist + version: '~> v2' + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: Upload assets - # uses: actions/upload-artifact@v2 - # with: - # name: kafta - # path: dist/* diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..b1c7b86 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,51 @@ +version: 2 + +before: + hooks: + - go mod tidy + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + - arm + - ppc64le + goarm: + - '7' + flags: + - -trimpath + ldflags: + - -s -w -X github.com/electric-saw/kafta/internal/version.version={{.Tag}} + - -X github.com/electric-saw/kafta/internal/version.metadata={{.Branch}} + - -X github.com/electric-saw/kafta/internal/version.gitCommit={{.ShortCommit}} + main: ./cmd/kafta + +archives: + - format: tar.gz + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/.goreleaser.yml b/.goreleaser2.yml similarity index 100% rename from .goreleaser.yml rename to .goreleaser2.yml