From 74dc687c1dabf24ededf637d937064cfe97d0556 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 25 Feb 2025 09:47:45 +0000 Subject: [PATCH] chore(ci): no complaints if the Go version is higher than required (#490) Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/490 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/test.yml | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index f2c3be1..c5aec79 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -49,8 +49,8 @@ jobs: set -ex toolchain=$(grep -oP '(?<=toolchain ).+' go.mod) version=$(go version | cut -d' ' -f3) - if [ "$toolchain" != "$version" ]; then - echo "go version mismatch: $toolchain <> $version" + if dpkg --compare-versions ${version#go} lt ${toolchain#go}; then + echo "go version too low: $toolchain >= $version" exit 1 fi diff --git a/Makefile b/Makefile index 3413168..cefd28b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ EXECUTABLE := forgejo-runner GOFMT ?= gofumpt -l DIST := dist DIST_DIRS := $(DIST)/binaries $(DIST)/release -GO ?= go +GO ?= $(shell go env GOROOT)/bin/go SHASUM ?= shasum -a 256 HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" ) XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest