From 964ec400a1ad75cee41d8c13e1dad9bed38265d1 Mon Sep 17 00:00:00 2001 From: christophe-duc Date: Fri, 9 Jan 2026 14:43:21 -0400 Subject: [PATCH] updated goreleaser to fix linux build problems --- .github/workflows/cd.yml | 4 ++++ .goreleaser.yml | 26 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9d820c80..51eb8f96 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,6 +19,10 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.25' + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross - name: Run goreleaser uses: goreleaser/goreleaser-action@v6 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index f9424833..46c199ba 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,19 +1,36 @@ # This is an example goreleaser.yaml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com -env: - - CGO_ENABLED=0 builds: - - id: binary + # macOS builds - CGO disabled (libpod not supported) + - id: darwin tags: - containers_image_openpgp - exclude_graphdriver_btrfs goos: - darwin + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + ldflags: + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=binaryRelease + + # Linux builds - CGO enabled (libpod support) + - id: linux + tags: + - containers_image_openpgp + - exclude_graphdriver_btrfs + goos: - linux goarch: - amd64 - arm64 + env: + - CGO_ENABLED=1 + - >- + {{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }} ldflags: - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=binaryRelease - id: snap @@ -30,7 +47,8 @@ builds: archives: - builds: - - binary + - darwin + - linux name_template: >- {{ .ProjectName }}_ {{- if eq .Os "darwin" }}Darwin