From c9f59899981b6d5f65c5dbb3243d69a849b025ca Mon Sep 17 00:00:00 2001 From: Oliver Braun Date: Thu, 23 Oct 2025 15:26:02 +0200 Subject: [PATCH] fix: build binaries on release --- .github/workflows/ci.yml | 7 ++++++- .goreleaser.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .goreleaser.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dca4e3..49ae0b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,11 +50,16 @@ jobs: steps: - uses: actions/checkout@master with: + fetch-depth: 0 persist-credentials: false + - uses: actions/setup-go@v5 + with: + go-version: 1.24.2 - uses: go-semantic-release/action@v1 + id: semrel with: changelog-file: "CHANGELOG.md" changelog-generator-opt: "emojis=true" - # allow-initial-development-versions: true + hooks: goreleaser env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..f9067de --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,36 @@ +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - -s -w -X main.version={{.Version}} + +archives: + - format: tar.gz + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: "checksums.txt" + +changelog: + skip: true