File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed
Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2020 - name : Show go version
2121 run : go version
2222 - name : Generate build files
23- run : make all
23+ run : make VERSION='$GITHUB_REF' all
2424 - name : Release
2525 uses : softprops/action-gh-release@v1
2626 with :
Original file line number Diff line number Diff line change 1- APP_GO_FILES := $( shell find . -name ' * .go')
1+ VERSION := v0.0.0
22
33all : linux_amd64.zip
44
@@ -7,8 +7,9 @@ linux_amd64.zip: build/linux_amd64 LICENSE
77
88build/linux_amd64 : build/linux_amd64/can build/linux_amd64/templates
99
10- build/linux_amd64/can : $(APP_GO_FILES )
11- go build -o ./build/linux_amd64/ ./cmd/...
10+ build/linux_amd64/can :
11+ echo ' ${VERSION}' > ./config/version.txt
12+ go build -o ./build/linux_amd64/ ./...
1213
1314build/linux_amd64/templates :
1415 cp -r templates build/linux_amd64/templates
Original file line number Diff line number Diff line change 11package config
22
33import (
4+ _ "embed"
45 "flag"
56 "fmt"
67 "github.com/spf13/viper"
78 "os"
89 "path/filepath"
910)
1011
11- // SemVer should be updated on any new release!!
12- const SemVer = "0.0.13"
12+ //go:embed version.txt
13+ var SemVer string
1314
1415var (
1516 Debug bool
Original file line number Diff line number Diff line change 1+ v0.0.0
You can’t perform that action at this time.
0 commit comments