File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,16 +52,15 @@ jobs:
5252 VERSION="0.0.0"
5353 fi
5454
55- VERSION=${{ github.ref_name }}
5655 COMMIT=${{ github.sha }}
57- DATE=$(date -u +%Y-%m-%dT %H:%M:%SZ )
56+ DATE=$(date -u +" %Y-%m-%d at %H:%M:%S" )
5857
5958 GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \
6059 go build \
6160 -ldflags "\
62- -X constants.Version=$VERSION \
63- -X constants.Commit=$COMMIT \
64- -X constants.BuildDate=$DATE \
61+ -X sklair/ constants.Version=$VERSION \
62+ -X sklair/ constants.Commit=$COMMIT \
63+ -X sklair/ constants.BuildDate=$DATE \
6564 " \
6665 -o dist/sklair-${{ matrix.os }}-${{ matrix.arch }}$EXT
6766
Original file line number Diff line number Diff line change 11package constants
22
3- var (
4- Version = "0.1.0" // to be replaced by ldflags during compile time in a GitHub runner
5- Commit = "unknown" // likewise
6- BuildDate = "unknown" // likewise, ISO-8601 UTC
3+ // these are replaced by ldflags during compile time on release
4+ const (
5+ Version = "0.0.0" // `MAJOR.MINOR.PATCH`, semantic versioning
6+ Commit = "unknown commit"
7+ BuildDate = "unknown date" // `YYYY-MM-DD at HH:MM:SS`
78)
8-
9- /*
10- VERSION=v0.0.0
11- COMMIT=$(git rev-parse --short HEAD)
12- DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
13-
14- go build \
15- -ldflags "\
16- -X sklair/constants.Version=$VERSION \
17- -X sklair/constants.Commit=$COMMIT \
18- -X sklair/constants.BuildDate=$DATE \
19- "
20- */
You can’t perform that action at this time.
0 commit comments