From 78e60f84bd6eb0cb31979f27fb2ef52f340e4280 Mon Sep 17 00:00:00 2001 From: Leandro Ferreira Date: Sat, 26 Oct 2024 12:04:26 -0300 Subject: [PATCH] update .goreleaser --- .github/workflows/goreleaser.yml | 30 +++++++++++++++++++++++++++--- .goreleaser.yaml | 26 ++++++++++++++++++++------ 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 63930ba..ccdc851 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -9,7 +9,7 @@ permissions: contents: write jobs: - goreleaser: + build-linux-windows: runs-on: ubuntu-latest steps: - name: Checkout @@ -18,11 +18,35 @@ jobs: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v5 - - name: Run GoReleaser + with: + go-version: '1.23' + - name: Run GoReleaser for Linux and Windows + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_TARGET: linux-windows uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser version: "~> v2" - args: release --clean + args: release --clean --skip=publish,validate + + build-macos: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + - name: Run GoReleaser for macOS env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_TARGET: macos + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v2" + args: release --clean --skip=publish,validate diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 49729f9..7ecc82c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,15 +6,32 @@ before: - go generate ./... builds: - - env: - - CGO_ENABLED=0 + - id: build-linux-windows goos: - - linux - windows + - linux + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + flags: + - -trimpath + ignore: + - env: BUILD_TARGET == 'macos' + + - id: build-macos + goos: - darwin goarch: - amd64 - arm64 + env: + - CGO_ENABLED=1 + flags: + - -trimpath + ignore: + - env: BUILD_TARGET == 'linux-windows' archives: - format: tar.gz @@ -39,9 +56,6 @@ changelog: checksum: name_template: "checksums.txt" -snapshot: - name_template: "{{ .Tag }}-{{ .ShortCommit }}" - release: github: owner: leandrodaf