fix inject version

This commit is contained in:
onyx-and-iris 2026-03-25 16:41:38 +00:00
parent f47d917cff
commit 5983f286d1

View File

@ -8,8 +8,8 @@ vars:
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe' WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64' LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64' MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64'
GIT_COMMIT: VERSION:
sh: git log -n 1 --format=%h sh: 'git describe --tags $(git rev-list --tags --max-count=1)'
tasks: tasks:
default: default:
@ -39,19 +39,19 @@ tasks:
build-windows: build-windows:
desc: Build the gogn project for Windows desc: Build the gogn project for Windows
cmds: cmds:
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.version={{.GIT_COMMIT}}" - GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.version={{.VERSION}}"
internal: true internal: true
build-linux: build-linux:
desc: Build the gogn project for Linux desc: Build the gogn project for Linux
cmds: cmds:
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.GIT_COMMIT}}" - GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.VERSION}}"
internal: true internal: true
build-macos: build-macos:
desc: Build the gogn project for macOS desc: Build the gogn project for macOS
cmds: cmds:
- GOOS=darwin GOARCH=amd64 go build -o {{.MACOS}} -ldflags="-X main.version={{.GIT_COMMIT}}" - GOOS=darwin GOARCH=amd64 go build -o {{.MACOS}} -ldflags="-X main.version={{.VERSION}}"
internal: true internal: true
test: test: