Skip to content

Commit

Permalink
Support CGO enabled builds for linux amd64 and darwin amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
kunickiaj committed Jul 17, 2021
1 parent db3bef4 commit 7feef42
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 9 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,28 @@ on:
- '*'

jobs:
goreleaser:
goreleaser-macos:
runs-on: macos-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0`
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release -f .goreleaser-macos.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
goreleaser-linux:
runs-on: ubuntu-latest
steps:
-
Expand All @@ -31,6 +52,6 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: release -f .goreleaser-linux.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
8 changes: 1 addition & 7 deletions .goreleaser.yml → .goreleaser-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ before:
- go mod download
builds:
- env:
- CGO_ENABLED=0
- CGO_ENABLED=1
ldflags:
- -s -w -X github.com/kunickiaj/beer/cmd.version={{.Version}}
goos:
- darwin
- linux
goarch:
- amd64
- arm
- arm64
archives:
- id: dist
replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
dockers:
-
goos: linux
Expand Down
53 changes: 53 additions & 0 deletions .goreleaser-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=1
ldflags:
- -s -w -X github.com/kunickiaj/beer/cmd.version={{.Version}}
goos:
- darwin
goarch:
- amd64
archives:
- id: dist
replacements:
darwin: Darwin
brews:
-
name: beer

# Repository to push the tap to.
tap:
owner: kunickiaj
name: homebrew-beer

url_template: "https://github.com/kunickiaj/beer/releases/download/{{ .Tag }}/{{ .ArtifactName }}"

commit_author:
name: goreleaserbot
email: [email protected]

folder: Formula

homepage: "https://github.com/kunickiaj/beer"
description: "CLI for managing your JIRA / Gerrit / git workflow."

skip_upload: auto

test: |
system "#{bin}/beer --help"
install: |
bin.install "beer"
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 7feef42

Please sign in to comment.