diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0b2bce1..9526975 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,7 +31,7 @@ jobs: fi - name: Build - run: GOOS=windows GOARCH=amd64 go build -v . + run: GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=$(git describe --tags HEAD)" -v . - name: Create build artifacts uses: actions/upload-artifact@v2 diff --git a/makefile b/makefile index 07ebaf6..9c75c0a 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ .DEFAULT_GOAL := build -GITVER = `git rev-parse HEAD` +GITVER = `git describe --tags HEAD` build: @go build -ldflags "-X main.version=${GITVER}"