Skip to content

Commit

Permalink
Build static binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
andresterba committed Jun 20, 2022
1 parent 6995e13 commit 28dec80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ builds:
env:
# needed for sqlite support
- CGO_ENABLED=1
ldflags:
- "-extldflags=-static"
tags:
- sqlite_omit_load_extension
goos:
- linux
# not able to build for these plattforms, as sqlite needs cgo
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BINARY_NAME=upstream-watch

all: build
build:
$(GOBUILD) -o $(BINARY_NAME) cmd/main.go
$(GOBUILD) -ldflags="-extldflags=-static" -tags sqlite_omit_load_extension -o $(BINARY_NAME) cmd/main.go
test:
$(GOTEST) ./...
clean:
Expand All @@ -17,7 +17,7 @@ clean:
run: build
./$(BINARY_NAME)
localtest: build
cp $(BINARY_NAME) ../../upstream-watch-test-repo/
cp $(BINARY_NAME) ../../upstream-watch-test-repo
testcoverage:
$(GOTEST) -coverprofile coverage.out ./... && go tool cover -html=coverage.out && rm coverage.out
lint:
Expand Down

0 comments on commit 28dec80

Please sign in to comment.