diff --git a/Makefile b/Makefile index b6d2439..76e1036 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SMAIL_VERSION ?= $(shell git describe --tags --always --dirty) GIT_HASH ?= $(shell git show -s --format=%H) BUILD_TIME ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ) -GO_VERSION ?= $(shell go version) +GO_VERSION ?= $(shell cd backend && go version) BUILD_LDFLAGS = -s -w -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.Version=$(SMAIL_VERSION)' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.GitHash=$(GIT_HASH)' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.BuildTime=$(BUILD_TIME)' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.GoVersion=$(GO_VERSION)' .PHONY: build clean clean_codex_test_artifacts build_fe build_server wechat_push spam_block telegram_push plugin package test test_mysql test_postgres diff --git a/test/frontend/output-paths.test.mjs b/test/frontend/output-paths.test.mjs index 4772d89..89c09b5 100644 --- a/test/frontend/output-paths.test.mjs +++ b/test/frontend/output-paths.test.mjs @@ -11,6 +11,7 @@ const read = relative => readFile(path.join(root, relative), 'utf8') test('跨平台构建输出不得越过项目 out 目录', async () => { const content = await read('Makefile') + assert.match(content, /GO_VERSION \?= \$\(shell cd backend && go version\)/) const commands = [...content.matchAll(/cd ([^\s]+) && [^\n]*go build [^\n]* -o ([^\s]+) /g)] assert.equal(commands.length, 12) for (const [, directory, output] of commands) {