make version on build time

This commit is contained in:
Andrea Spacca 2021-07-07 20:51:05 +02:00
parent ce0c9b8915
commit 811679f8fb
2 changed files with 2 additions and 2 deletions

View file

@ -35,7 +35,7 @@ jobs:
CGO_ENABLED: 0
run: |
go version
go build -tags netgo -ldflags '-a -s -w -extldflags "-static"' -o ./artifacts/transfersh-${GITHUB_REF##*/}-${{ matrix.suffix }}
go build -tags netgo -ldflags '-X github.com/dutchcoders/transfer.sh/cmd.Version=${GITHUB_REF##*/} -a -s -w -extldflags "-static"' -o ./artifacts/transfersh-${GITHUB_REF##*/}-${{ matrix.suffix }}
- uses: actions/upload-artifact@v2
name: Upload artifacts
with:

View file

@ -12,7 +12,7 @@ import (
"google.golang.org/api/googleapi"
)
var Version = "1.2.4"
var Version = "0.0.0"
var helpTemplate = `NAME:
{{.Name}} - {{.Usage}}