Skip to content

Commit

Permalink
update .goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandro Ferreira committed Oct 26, 2024
1 parent 91d04ec commit 78e60f8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: write

jobs:
goreleaser:
build-linux-windows:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -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
26 changes: 20 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,9 +56,6 @@ changelog:
checksum:
name_template: "checksums.txt"

snapshot:
name_template: "{{ .Tag }}-{{ .ShortCommit }}"

release:
github:
owner: leandrodaf
Expand Down

0 comments on commit 78e60f8

Please sign in to comment.