Skip to content

Commit

Permalink
add build code for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
hjhee committed Apr 2, 2021
1 parent 6d96c0c commit 4c49b0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down

0 comments on commit 4c49b0b

Please sign in to comment.