Skip to content

Commit

Permalink
fix: typo CGO_ENABLED instead of GCO_ENABLED (#791)
Browse files Browse the repository at this point in the history
* fix: use old binary for linux x64

* ci: goreleaser --verbose

* FIX: TYPO

* revert: static link flags
  • Loading branch information
mrexox authored Jul 26, 2024
1 parent 3fe0692 commit 32d93a7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 32d93a7

Please sign in to comment.