mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 16:07:45 +08:00
fix: update Makefile to specify Go toolchain version and adjust pre-commit hook installation
This commit is contained in:
@@ -28,7 +28,7 @@ build: ## build hrp cli tool
|
|||||||
# -w : 忽略 DWARF 调试信息
|
# -w : 忽略 DWARF 调试信息
|
||||||
# -extldflags "-static" : 传递给外部链接器的标志,强制静态链接
|
# -extldflags "-static" : 传递给外部链接器的标志,强制静态链接
|
||||||
@echo "[info] build hrp cli tool"
|
@echo "[info] build hrp cli tool"
|
||||||
go mod tidy
|
GOTOOLCHAIN=go1.23 go mod tidy
|
||||||
GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} CGO_ENABLED=0 go build -tags netgo,osusergo -trimpath -ldflags "\
|
GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} CGO_ENABLED=0 go build -tags netgo,osusergo -trimpath -ldflags "\
|
||||||
-s -w \
|
-s -w \
|
||||||
-X 'github.com/httprunner/httprunner/v5/internal/version.GitCommit=$(shell git rev-parse HEAD)' \
|
-X 'github.com/httprunner/httprunner/v5/internal/version.GitCommit=$(shell git rev-parse HEAD)' \
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v5.0.0-250627
|
v5.0.0-250628
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ PRE_COMMIT_FILE=.git/hooks/pre-commit
|
|||||||
|
|
||||||
# install pre-commit hook and make it executable
|
# install pre-commit hook and make it executable
|
||||||
function install() {
|
function install() {
|
||||||
go get mvdan.cc/gofumpt
|
# Install tools without modifying go.mod to avoid Go toolchain upgrade
|
||||||
go get github.com/incu6us/goimports-reviser/v3@latest
|
go install mvdan.cc/gofumpt@latest
|
||||||
|
go install github.com/incu6us/goimports-reviser/v3@latest
|
||||||
cat > $PRE_COMMIT_FILE <<'EOF'
|
cat > $PRE_COMMIT_FILE <<'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ version_file=internal/version/VERSION
|
|||||||
current_date=$(date +"%y%m%d")
|
current_date=$(date +"%y%m%d")
|
||||||
|
|
||||||
# update version
|
# update version
|
||||||
sed -i '' "s/[0-9]\{10\}/${current_date}/" "$version_file"
|
sed -i '' "s/[0-9]\{6\}/${current_date}/" "$version_file"
|
||||||
|
|
||||||
# add change to stage
|
# add change to stage
|
||||||
git add $version_file
|
git add $version_file
|
||||||
|
|||||||
Reference in New Issue
Block a user