From aff9a0b25881423f93216eceed547018fcc2bc62 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Thu, 8 Oct 2020 17:54:24 -0600 Subject: [PATCH] static build attempt 2. --- .github/workflows/build.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c6129a2..9139e07 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,13 +27,13 @@ jobs: env: GOOS: linux GOARCH: amd64 - CGO_ENABLED: 0 + CGO_ENABLED: 1 run: | apt-get update && apt-get install -y file cd $PROJECT_PATH - go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-web-linux-amd64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go - go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-collector-metrics-linux-amd64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go + go build -ldflags "-extldflags=-static -X main.goos=linux -X main.goarch=amd64" -o scrutiny-web-linux-amd64 -tags "static sqlite_omit_load_extension" webapp/backend/cmd/scrutiny/scrutiny.go + go build -ldflags "-extldflags=-static -X main.goos=linux -X main.goarch=amd64" -o scrutiny-collector-metrics-linux-amd64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go chmod +x scrutiny-web-linux-amd64 chmod +x scrutiny-collector-metrics-linux-amd64 @@ -44,7 +44,6 @@ jobs: env: GOOS: linux GOARCH: arm - CGO_ENABLED: 0 run: | cd $PROJECT_PATH go build -ldflags "-X main.goos=linux -X main.goarch=arm" -o scrutiny-web-linux-arm -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go @@ -57,7 +56,6 @@ jobs: env: GOOS: linux GOARCH: arm64 - CGO_ENABLED: 0 run: | cd $PROJECT_PATH go build -ldflags "-X main.goos=linux -X main.goarch=arm64" -o scrutiny-web-linux-arm64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go @@ -79,7 +77,6 @@ jobs: env: GOOS: freebsd GOARCH: amd64 - CGO_ENABLED: 0 run: | cd $PROJECT_PATH go build -ldflags "-X main.goos=freebsd -X main.goarch=amd64" -o scrutiny-web-freebsd-amd64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go