diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9fe4f3f..eea57e0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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: diff --git a/.goreleaser.yml b/.goreleaser.yml index 21fec9b..f892d49 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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