Skip to content

Commit

Permalink
fix: use static builds in go releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahanmmi committed Jun 17, 2024
1 parent a9a8389 commit e2f78b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64"
sudo mv cosign-linux-amd64 /usr/local/bin/cosign
sudo chmod +x /usr/local/bin/cosign
- name: Install musl cc
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: musl-tools musl-dev musl
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
12 changes: 9 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,37 @@ builds:
- id: linux
binary: kaytu
ldflags:
- -s -w -X github.com/{{ .Env.REPOSITORY_OWNER }}/{{ .Env.REPOSITORY_NAME }}/pkg/version.VERSION={{ .Version }}
- -s -w -linkmode external -extldflags '-static' -X github.com/{{ .Env.REPOSITORY_OWNER }}/{{ .Env.REPOSITORY_NAME }}/pkg/version.VERSION={{ .Version }}
goos:
- linux
goarch:
- amd64
- arm64
env:
- CC=/usr/bin/musl-gcc
main: ./main.go
- id: darwin
binary: kaytu
ldflags:
- -s -w -X github.com/{{ .Env.REPOSITORY_OWNER }}/{{ .Env.REPOSITORY_NAME }}/pkg/version.VERSION={{ .Version }}
- -s -w -linkmode external -extldflags '-static' -X github.com/{{ .Env.REPOSITORY_OWNER }}/{{ .Env.REPOSITORY_NAME }}/pkg/version.VERSION={{ .Version }}
goos:
- darwin
goarch:
- amd64
- arm64
env:
- CC=/usr/bin/musl-gcc
main: ./main.go
- id: windows
binary: kaytu
ldflags:
- -s -w -X github.com/{{ .Env.REPOSITORY_OWNER }}/{{ .Env.REPOSITORY_NAME }}/pkg/version.VERSION={{ .Version }}
- -s -w -linkmode external -extldflags '-static' -X github.com/{{ .Env.REPOSITORY_OWNER }}/{{ .Env.REPOSITORY_NAME }}/pkg/version.VERSION={{ .Version }}
goos:
- windows
goarch:
- amd64
env:
- CC=/usr/bin/musl-gcc
main: ./main.go
archives:
- id: binary
Expand Down

0 comments on commit e2f78b6

Please sign in to comment.