From 32d93a7f28f8a5c1e2bc20797436545e0a028671 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Fri, 26 Jul 2024 12:09:59 +0300 Subject: [PATCH] fix: typo CGO_ENABLED instead of GCO_ENABLED (#791) * fix: use old binary for linux x64 * ci: goreleaser --verbose * FIX: TYPO * revert: static link flags --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- .goreleaser.yml | 8 +++----- Makefile | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 403a2c80..ec7c4b1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: with: distribution: goreleaser version: '~> v2' - args: release --clean + args: release --clean --verbose env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a18cae7..110bbef6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: with: distribution: goreleaser version: '~> v2' - args: release --snapshot --skip=publish --skip=snapcraft --skip=validate --clean + args: release --snapshot --skip=publish --skip=snapcraft --skip=validate --clean --verbose - name: Tar binaries to preserve executable bit run: 'tar -cvf lefthook-binaries.tar --directory dist/ $(find dist/ -executable -type f -printf "%P\0" | xargs --null)' - name: Upload binaries as artifacts diff --git a/.goreleaser.yml b/.goreleaser.yml index 1f7d56bc..743254c1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,11 +7,9 @@ builds: # Builds the binaries without `lefthook upgrade` - id: no_self_update tags: - - osusergo - - netgo - no_self_update env: - - GCO_ENABLED=0 + - CGO_ENABLED=0 goos: - linux - darwin @@ -31,7 +29,7 @@ builds: flags: - -trimpath ldflags: - - -s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} # Full lefthook binary - id: lefthook @@ -56,7 +54,7 @@ builds: flags: - -trimpath ldflags: - - -s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} archives: - id: lefthook diff --git a/Makefile b/Makefile index 192170d6..e73c1409 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ COMMIT_HASH = $(shell git rev-parse HEAD) build: - go build -ldflags "-s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook + go build -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook build-with-coverage: - go build -cover -ldflags "-s -w extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook + go build -cover -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook install: build cp lefthook $$(go env GOPATH)/bin