Skip to content

Commit aaa0bcd

Browse files
authored
version is now added automatically by the CI (#4)
* version is now added automatically by the CI * use go 16 as requested by go.mod
1 parent c1843b7 commit aaa0bcd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ jobs:
143143
- name: Install Go
144144
uses: actions/setup-go@v2
145145
with:
146-
go-version: "1.15.8"
146+
go-version: "1.16.2"
147147

148148
- name: Build rp2040load
149-
run: go build
149+
run: go build -ldflags '-X main.version=${GITHUB_REF##*/}'
150150
env:
151151
GOOS: ${{ matrix.config.os }}
152152
GOARCH: ${{ matrix.config.arch }}

main.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import (
1515
var (
1616
verbose = flag.Bool("v", false, "Show verbose logging")
1717
binary = flag.String("D", "", "Path of the elf file to load")
18+
version = "0.0.0-dev" // CI will take care of it
1819
)
1920

20-
const Version = "1.0.1"
21-
2221
func PrintlnVerbose(a ...interface{}) {
2322
if *verbose {
2423
fmt.Println(a...)
@@ -36,7 +35,7 @@ func main() {
3635
path, _ := filepath.Abs(filepath.Dir(os.Args[0]))
3736
flag.Parse()
3837

39-
PrintlnVerbose(name + " " + Version + " - compiled with " + runtime.Version())
38+
PrintlnVerbose(name + " " + version + " - compiled with " + runtime.Version())
4039

4140
convert := []string{filepath.Join(path, "elf2uf2"), *binary, *binary + ".uf2"}
4241
launchCommandAndWaitForOutput(convert, false, false)

0 commit comments

Comments
 (0)