trying again to make ldflags work with slsa

This commit is contained in:
David Dworken 2022-04-08 22:12:00 -07:00
parent c3d232ea36
commit 13d766a9c8
3 changed files with 9 additions and 2 deletions

View File

@ -21,7 +21,8 @@ jobs:
- id: ldflags - id: ldflags
run: | run: |
GIT_HASH=$(git rev-list -1 HEAD) GIT_HASH=$(git rev-list -1 HEAD)
echo "-X main.GitCommit=$GIT_HASH -w -extldflags \"-static\"" LD_FLAGS="-X main.GitCommit=$GIT_HASH -w -extldflags \"-static\""
echo "::set-output name=value::$LD_FLAGS"
# Trusted builder. # Trusted builder.
build: build:

View File

@ -1,8 +1,13 @@
test: test:
HISHTORY_TEST=1 go test -p 1 ./... HISHTORY_TEST=1 go test -p 1 ./...
release:
expr `cat VERSION` + 1 > VERSION
git tag v0.`cat VERSION`
git push --tags
build-binary: build-binary:
go build -trimpath -o web/landing/www/binaries/hishtory-linux -ldflags "-X main.GitCommit=`git rev-list -1 HEAD`" go build -trimpath -o web/landing/www/binaries/hishtory-linux #-ldflags "-X main.GitCommit=`git rev-list -1 HEAD`"
install: build-binary install: build-binary
web/landing/www/binaries/hishtory-linux install web/landing/www/binaries/hishtory-linux install

1
VERSION Normal file
View File

@ -0,0 +1 @@
3