mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-09 16:50:28 +00:00
Inject version when building and report version to Gitea via log and header (#43)
close #42 1. Inject runner version when `make build` After building, executing command line: `./act_runner -v` or `./act_runner --version`, the version of runner is printed.  2. In `Actions` UI:  3. Set request header in http client interceptor. Co-authored-by: sillyguodong <[email protected]> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/43 Reviewed-by: delvh <[email protected]> Reviewed-by: Jason Song <[email protected]> Co-authored-by: sillyguodong <[email protected]> Co-committed-by: sillyguodong <[email protected]>
This commit is contained in:
1 parent
ebcf341de7
commit
0d71463662
9 files changed
+24
-13
No files matched your search
@@ -9,6 +9,7 @@ HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||
XGO_VERSION := go-1.18.x
|
||||
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
|
||||
RUNNER_CMD_PACKAGE_PATH := gitea.com/gitea/act_runner/cmd
|
||||
|
||||
LINUX_ARCHS ?= linux/amd64,linux/arm64
|
||||
DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64
|
||||
@@ -49,7 +50,7 @@ else
|
||||
ifneq ($(DRONE_BRANCH),)
|
||||
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||
else
|
||||
VERSION ?= master
|
||||
VERSION ?= main
|
||||
endif
|
||||
|
||||
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
|
||||
@@ -61,7 +62,7 @@ else
|
||||
endif
|
||||
|
||||
TAGS ?=
|
||||
LDFLAGS ?= -X 'main.Version=$(VERSION)'
|
||||
LDFLAGS ?= -X "$(RUNNER_CMD_PACKAGE_PATH).version=$(RELASE_VERSION)"
|
||||
|
||||
all: build
|
||||
|
||||
|
||||
Reference in new issue
Block a user