From 4c2ab943a8b85f940ce7e0a4cff23e852cee02c5 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Aug 2026 20:05:42 +0000 Subject: [PATCH] chore: bump the module path to `/v3`, take the version from the VCS stamp (#1136) gitea can not consume the runner's api by version while it's version mismatches the module version: ``` go: gitea.com/gitea/runner@v3.0.1: invalid version: module contains a go.mod file, so module path must match major version ("gitea.com/gitea/runner/v3") ``` Fix that by bumping the module version now. The existing `v3.0.0` and `v3.0.1` tags stay unusable, so a new tag is needed after this lands. Also drop the version `-X` linker flags, which would otherwise have to repeat the new path in both `Makefile` and `.goreleaser.yaml`, where a stale path makes injection silently no-op. Go has recorded the module version in the build info since 1.24, so `Version()` reads it from there, keeping the variable as an override for builds without a VCS stamp. That part started as https://gitea.com/gitea/runner/pulls/1137 but belongs here: the stamp resolves against the tags that are legal for the module path, so without the `/v3` bump it would report `v1.0.9-0.-`. Since `release-nightly.yml` triggers on every push to `main`, splitting them would publish a nightly with a `v1` version. --------- Co-authored-by: bircni Reviewed-on: https://gitea.com/gitea/runner/pulls/1136 Reviewed-by: techknowlogick <9+techknowlogick@noreply.gitea.com> Reviewed-by: bircni Co-authored-by: silverwind --- .goreleaser.yaml | 2 +- Makefile | 12 +---------- act/artifactcache/handler.go | 2 +- act/artifacts/server.go | 2 +- act/common/git/git.go | 4 ++-- act/common/git/git_test.go | 2 +- act/container/container_types.go | 2 +- act/container/docker_auth.go | 2 +- act/container/docker_build.go | 2 +- act/container/docker_network.go | 2 +- act/container/docker_pull.go | 2 +- act/container/docker_run.go | 4 ++-- act/container/docker_run_test.go | 2 +- act/container/docker_stub.go | 2 +- act/container/docker_volume.go | 2 +- act/container/host_environment.go | 8 +++---- act/container/host_environment_test.go | 2 +- act/container/parse_env_file.go | 2 +- act/exprparser/functions.go | 2 +- act/exprparser/functions_test.go | 2 +- act/exprparser/interpreter.go | 2 +- act/exprparser/interpreter_test.go | 2 +- act/model/github_context.go | 4 ++-- act/model/workflow.go | 2 +- act/runner/action.go | 8 +++---- act/runner/action_cache_test.go | 4 ++-- act/runner/action_composite.go | 4 ++-- act/runner/action_test.go | 8 +++---- act/runner/cancellation_test.go | 6 +++--- act/runner/command.go | 2 +- act/runner/command_test.go | 4 ++-- act/runner/container_mock_test.go | 4 ++-- act/runner/expression.go | 8 +++---- act/runner/expression_test.go | 4 ++-- act/runner/helpers_test.go | 2 +- act/runner/job_executor.go | 8 +++---- act/runner/job_executor_test.go | 6 +++--- act/runner/job_hooks.go | 4 ++-- act/runner/job_hooks_test.go | 4 ++-- act/runner/local_repository_cache.go | 2 +- act/runner/logger.go | 2 +- act/runner/max_parallel_test.go | 2 +- act/runner/reusable_workflow.go | 6 +++--- act/runner/reusable_workflow_test.go | 4 ++-- act/runner/run_context.go | 10 ++++----- act/runner/run_context_test.go | 8 +++---- act/runner/runner.go | 6 +++--- act/runner/runner_test.go | 4 ++-- act/runner/step.go | 8 +++---- act/runner/step_action_local.go | 4 ++-- act/runner/step_action_local_test.go | 4 ++-- act/runner/step_action_remote.go | 6 +++--- act/runner/step_action_remote_test.go | 6 +++--- act/runner/step_docker.go | 6 +++--- act/runner/step_docker_test.go | 4 ++-- act/runner/step_factory.go | 2 +- act/runner/step_factory_test.go | 2 +- act/runner/step_run.go | 8 +++---- act/runner/step_run_print_test.go | 4 ++-- act/runner/step_run_test.go | 4 ++-- act/runner/step_test.go | 4 ++-- act/runner/toolkit_patch.go | 6 +++--- act/runner/toolkit_patch_e2e_test.go | 2 +- act/runner/toolkit_patch_test.go | 2 +- go.mod | 2 +- internal/app/cmd/bug_report.go | 2 +- internal/app/cmd/cache-server.go | 4 ++-- internal/app/cmd/cmd.go | 2 +- internal/app/cmd/config.go | 2 +- internal/app/cmd/config_test.go | 2 +- internal/app/cmd/daemon.go | 18 ++++++++-------- internal/app/cmd/daemon_test.go | 2 +- internal/app/cmd/exec.go | 12 +++++------ internal/app/cmd/exec_test.go | 2 +- internal/app/cmd/register.go | 12 +++++------ internal/app/cmd/register_test.go | 2 +- internal/app/poll/poller.go | 6 +++--- internal/app/poll/poller_test.go | 4 ++-- internal/app/run/disk_test.go | 2 +- internal/app/run/health_check.go | 4 ++-- internal/app/run/health_check_test.go | 2 +- internal/app/run/post_task_script.go | 10 ++++----- internal/app/run/post_task_script_test.go | 6 +++--- internal/app/run/proxy.go | 2 +- internal/app/run/runner.go | 22 ++++++++++---------- internal/app/run/runner_cache_test.go | 4 ++-- internal/app/run/runner_idle_cleanup_test.go | 2 +- internal/app/run/runner_test.go | 8 +++---- internal/app/run/setup.go | 4 ++-- internal/app/run/setup_test.go | 4 ++-- internal/app/run/workflow.go | 2 +- internal/app/run/workflow_test.go | 2 +- internal/pkg/client/http.go | 2 +- internal/pkg/report/reporter.go | 8 +++---- internal/pkg/report/reporter_test.go | 6 +++--- internal/pkg/ver/version.go | 14 ++++++++++--- internal/pkg/ver/version_test.go | 7 ++++++- main.go | 2 +- tools/coverage-report.ts | 2 +- 99 files changed, 226 insertions(+), 223 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d6e454e5..9c1d9bd9 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -65,7 +65,7 @@ builds: flags: - -trimpath ldflags: - - -s -w -X gitea.com/gitea/runner/internal/pkg/ver.version={{ .Summary }} + - -s -w binary: >- {{ .ProjectName }}- {{- .Version }}- diff --git a/Makefile b/Makefile index 10b83389..97215f84 100644 --- a/Makefile +++ b/Makefile @@ -51,28 +51,18 @@ else GO_ENV_WINDOWS := GOOS=windows endif -STORED_VERSION_FILE := VERSION - ifneq ($(DRONE_TAG),) VERSION ?= $(subst v,,$(DRONE_TAG)) - RELASE_VERSION ?= $(VERSION) else ifneq ($(DRONE_BRANCH),) VERSION ?= $(subst release/v,,$(DRONE_BRANCH)) else VERSION ?= main endif - - STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null) - ifneq ($(STORED_VERSION),) - RELASE_VERSION ?= $(STORED_VERSION) - else - RELASE_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') - endif endif TAGS ?= -LDFLAGS ?= -X "gitea.com/gitea/runner/internal/pkg/ver.version=v$(RELASE_VERSION)" +LDFLAGS ?= .PHONY: all all: build diff --git a/act/artifactcache/handler.go b/act/artifactcache/handler.go index 3cf2174a..6bad186b 100644 --- a/act/artifactcache/handler.go +++ b/act/artifactcache/handler.go @@ -26,7 +26,7 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/julienschmidt/httprouter" "github.com/sirupsen/logrus" diff --git a/act/artifacts/server.go b/act/artifacts/server.go index fb4e8b6b..f0451825 100644 --- a/act/artifacts/server.go +++ b/act/artifacts/server.go @@ -17,7 +17,7 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/julienschmidt/httprouter" ) diff --git a/act/common/git/git.go b/act/common/git/git.go index fab65532..0dab5d03 100644 --- a/act/common/git/git.go +++ b/act/common/git/git.go @@ -15,8 +15,8 @@ import ( "strings" "sync" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/internal/pkg/lock" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/internal/pkg/lock" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/config" diff --git a/act/common/git/git_test.go b/act/common/git/git_test.go index 6984130e..53389670 100644 --- a/act/common/git/git_test.go +++ b/act/common/git/git_test.go @@ -16,7 +16,7 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" log "github.com/sirupsen/logrus" logrustest "github.com/sirupsen/logrus/hooks/test" diff --git a/act/container/container_types.go b/act/container/container_types.go index f4df9700..7ffc2e4c 100644 --- a/act/container/container_types.go +++ b/act/container/container_types.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/docker/go-connections/nat" "github.com/moby/moby/api/types/container" diff --git a/act/container/docker_auth.go b/act/container/docker_auth.go index 8f5f2fa8..dc344aae 100644 --- a/act/container/docker_auth.go +++ b/act/container/docker_auth.go @@ -9,7 +9,7 @@ package container import ( "context" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/distribution/reference" "github.com/docker/cli/cli/config" diff --git a/act/container/docker_build.go b/act/container/docker_build.go index 2e072252..fadf3ac8 100644 --- a/act/container/docker_build.go +++ b/act/container/docker_build.go @@ -12,7 +12,7 @@ import ( "os" "path/filepath" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/moby/go-archive" "github.com/moby/go-archive/compression" diff --git a/act/container/docker_network.go b/act/container/docker_network.go index 406d1907..3201b322 100644 --- a/act/container/docker_network.go +++ b/act/container/docker_network.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/moby/moby/client" ) diff --git a/act/container/docker_pull.go b/act/container/docker_pull.go index 3204dcc1..51184ff4 100644 --- a/act/container/docker_pull.go +++ b/act/container/docker_pull.go @@ -11,7 +11,7 @@ import ( "fmt" "strings" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/distribution/reference" "github.com/moby/moby/api/pkg/authconfig" diff --git a/act/container/docker_run.go b/act/container/docker_run.go index 1db35b67..8f3d7a90 100644 --- a/act/container/docker_run.go +++ b/act/container/docker_run.go @@ -23,8 +23,8 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/filecollector" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/filecollector" "dario.cat/mergo" cerrdefs "github.com/containerd/errdefs" diff --git a/act/container/docker_run_test.go b/act/container/docker_run_test.go index d6a60d47..62528bb9 100644 --- a/act/container/docker_run_test.go +++ b/act/container/docker_run_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/pkg/stdcopy" diff --git a/act/container/docker_stub.go b/act/container/docker_stub.go index 0db4febe..9ba332c9 100644 --- a/act/container/docker_stub.go +++ b/act/container/docker_stub.go @@ -12,7 +12,7 @@ import ( "runtime" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/moby/moby/api/types/system" ) diff --git a/act/container/docker_volume.go b/act/container/docker_volume.go index 30046ea7..b871d55b 100644 --- a/act/container/docker_volume.go +++ b/act/container/docker_volume.go @@ -9,7 +9,7 @@ package container import ( "context" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/moby/moby/client" ) diff --git a/act/container/host_environment.go b/act/container/host_environment.go index f963cb70..225a6650 100644 --- a/act/container/host_environment.go +++ b/act/container/host_environment.go @@ -21,10 +21,10 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/filecollector" - "gitea.com/gitea/runner/act/lookpath" - "gitea.com/gitea/runner/internal/pkg/process" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/filecollector" + "gitea.com/gitea/runner/v3/act/lookpath" + "gitea.com/gitea/runner/v3/internal/pkg/process" "github.com/go-git/go-billy/v5/helper/polyfill" "github.com/go-git/go-billy/v5/osfs" diff --git a/act/container/host_environment_test.go b/act/container/host_environment_test.go index 2f5d1c5e..73eac4d5 100644 --- a/act/container/host_environment_test.go +++ b/act/container/host_environment_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/act/container/parse_env_file.go b/act/container/parse_env_file.go index ec8f1545..e4d4349f 100644 --- a/act/container/parse_env_file.go +++ b/act/container/parse_env_file.go @@ -12,7 +12,7 @@ import ( "io" "strings" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "golang.org/x/text/encoding/unicode" "golang.org/x/text/transform" diff --git a/act/exprparser/functions.go b/act/exprparser/functions.go index 7987273b..b9bb5e20 100644 --- a/act/exprparser/functions.go +++ b/act/exprparser/functions.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/go-git/go-git/v5/plumbing/format/gitignore" "github.com/rhysd/actionlint" diff --git a/act/exprparser/functions_test.go b/act/exprparser/functions_test.go index b380f586..b827df2d 100644 --- a/act/exprparser/functions_test.go +++ b/act/exprparser/functions_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/exprparser/interpreter.go b/act/exprparser/interpreter.go index 4bed3e85..ee3d1e67 100644 --- a/act/exprparser/interpreter.go +++ b/act/exprparser/interpreter.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/rhysd/actionlint" ) diff --git a/act/exprparser/interpreter_test.go b/act/exprparser/interpreter_test.go index 4d25dcc1..4828ba83 100644 --- a/act/exprparser/interpreter_test.go +++ b/act/exprparser/interpreter_test.go @@ -9,7 +9,7 @@ import ( "reflect" "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/act/model/github_context.go b/act/model/github_context.go index c70fb240..c3d3d024 100644 --- a/act/model/github_context.go +++ b/act/model/github_context.go @@ -9,8 +9,8 @@ import ( "fmt" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" ) type GithubContext struct { diff --git a/act/model/workflow.go b/act/model/workflow.go index 0b4370b4..59527bba 100644 --- a/act/model/workflow.go +++ b/act/model/workflow.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" log "github.com/sirupsen/logrus" "go.yaml.in/yaml/v4" diff --git a/act/runner/action.go b/act/runner/action.go index da2e811a..1b856ae1 100644 --- a/act/runner/action.go +++ b/act/runner/action.go @@ -20,10 +20,10 @@ import ( "runtime" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/action_cache_test.go b/act/runner/action_cache_test.go index 5b185964..846f168b 100644 --- a/act/runner/action_cache_test.go +++ b/act/runner/action_cache_test.go @@ -17,8 +17,8 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/act/runner/action_composite.go b/act/runner/action_composite.go index bdbc4eeb..6aa5ec06 100644 --- a/act/runner/action_composite.go +++ b/act/runner/action_composite.go @@ -12,8 +12,8 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" ) func evaluateCompositeInputAndEnv(ctx context.Context, parent *RunContext, step actionStep) map[string]string { diff --git a/act/runner/action_test.go b/act/runner/action_test.go index eb068881..725c5cfb 100644 --- a/act/runner/action_test.go +++ b/act/runner/action_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/cancellation_test.go b/act/runner/cancellation_test.go index add340ce..75c28859 100644 --- a/act/runner/cancellation_test.go +++ b/act/runner/cancellation_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/act/runner/command.go b/act/runner/command.go index ef8fc836..a6903f69 100644 --- a/act/runner/command.go +++ b/act/runner/command.go @@ -10,7 +10,7 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" ) var commandPatternGA *regexp.Regexp diff --git a/act/runner/command_test.go b/act/runner/command_test.go index 16cdb5a4..172fe556 100644 --- a/act/runner/command_test.go +++ b/act/runner/command_test.go @@ -11,8 +11,8 @@ import ( "os" "testing" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" diff --git a/act/runner/container_mock_test.go b/act/runner/container_mock_test.go index 8a56b26f..fe514240 100644 --- a/act/runner/container_mock_test.go +++ b/act/runner/container_mock_test.go @@ -8,8 +8,8 @@ import ( "context" "io" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" "github.com/stretchr/testify/mock" ) diff --git a/act/runner/expression.go b/act/runner/expression.go index c382ea15..5945d9bb 100644 --- a/act/runner/expression.go +++ b/act/runner/expression.go @@ -16,10 +16,10 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" _ "embed" diff --git a/act/runner/expression_test.go b/act/runner/expression_test.go index 13719e4c..2962b606 100644 --- a/act/runner/expression_test.go +++ b/act/runner/expression_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" assert "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/act/runner/helpers_test.go b/act/runner/helpers_test.go index 40434dfa..ae76534a 100644 --- a/act/runner/helpers_test.go +++ b/act/runner/helpers_test.go @@ -9,7 +9,7 @@ import ( "runtime" "testing" - "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/v3/act/container" mobyclient "github.com/moby/moby/client" ) diff --git a/act/runner/job_executor.go b/act/runner/job_executor.go index 2559ac83..4e06a47b 100644 --- a/act/runner/job_executor.go +++ b/act/runner/job_executor.go @@ -21,10 +21,10 @@ import ( "time" "unicode" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" ) const maxJobSummaryBytes = 1024 * 1024 diff --git a/act/runner/job_executor_test.go b/act/runner/job_executor_test.go index 6247c6eb..618650d5 100644 --- a/act/runner/job_executor_test.go +++ b/act/runner/job_executor_test.go @@ -20,9 +20,9 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" log "github.com/sirupsen/logrus" logrustest "github.com/sirupsen/logrus/hooks/test" diff --git a/act/runner/job_hooks.go b/act/runner/job_hooks.go index e39ee739..847245da 100644 --- a/act/runner/job_hooks.go +++ b/act/runner/job_hooks.go @@ -11,8 +11,8 @@ import ( "path" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" ) // GitHub's job-hook variables, read as a fallback when the settings are unset. diff --git a/act/runner/job_hooks_test.go b/act/runner/job_hooks_test.go index 51ec4fc8..6294727b 100644 --- a/act/runner/job_hooks_test.go +++ b/act/runner/job_hooks_test.go @@ -11,8 +11,8 @@ import ( "maps" "testing" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" diff --git a/act/runner/local_repository_cache.go b/act/runner/local_repository_cache.go index d8e1ebad..e76630c6 100644 --- a/act/runner/local_repository_cache.go +++ b/act/runner/local_repository_cache.go @@ -16,7 +16,7 @@ import ( "path/filepath" "strings" - "gitea.com/gitea/runner/act/filecollector" + "gitea.com/gitea/runner/v3/act/filecollector" ) type LocalRepositoryCache struct { diff --git a/act/runner/logger.go b/act/runner/logger.go index 615fc0e4..e0caba90 100644 --- a/act/runner/logger.go +++ b/act/runner/logger.go @@ -17,7 +17,7 @@ import ( "strings" "sync" - "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/v3/act/common" "github.com/sirupsen/logrus" "golang.org/x/term" diff --git a/act/runner/max_parallel_test.go b/act/runner/max_parallel_test.go index aba5d980..aa10b2ca 100644 --- a/act/runner/max_parallel_test.go +++ b/act/runner/max_parallel_test.go @@ -6,7 +6,7 @@ package runner import ( "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "go.yaml.in/yaml/v4" diff --git a/act/runner/reusable_workflow.go b/act/runner/reusable_workflow.go index 00e98027..b1da9d02 100644 --- a/act/runner/reusable_workflow.go +++ b/act/runner/reusable_workflow.go @@ -14,9 +14,9 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/model" ) func newLocalReusableWorkflowExecutor(rc *RunContext) common.Executor { diff --git a/act/runner/reusable_workflow_test.go b/act/runner/reusable_workflow_test.go index 401ee39d..2cd5a9c9 100644 --- a/act/runner/reusable_workflow_test.go +++ b/act/runner/reusable_workflow_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/require" ) diff --git a/act/runner/run_context.go b/act/runner/run_context.go index 1b0c1a35..2fc868c5 100644 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" - "gitea.com/gitea/runner/internal/pkg/lock" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/v3/internal/pkg/lock" "github.com/docker/cli/cli/compose/loader" "github.com/docker/go-connections/nat" diff --git a/act/runner/run_context_test.go b/act/runner/run_context_test.go index 962c7704..367a720b 100644 --- a/act/runner/run_context_test.go +++ b/act/runner/run_context_test.go @@ -15,10 +15,10 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" "github.com/docker/cli/cli/compose/loader" log "github.com/sirupsen/logrus" diff --git a/act/runner/runner.go b/act/runner/runner.go index 1eaddccb..dfee3bb0 100644 --- a/act/runner/runner.go +++ b/act/runner/runner.go @@ -14,9 +14,9 @@ import ( "sync" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" docker_container "github.com/moby/moby/api/types/container" log "github.com/sirupsen/logrus" diff --git a/act/runner/runner_test.go b/act/runner/runner_test.go index 922c0f02..f3f90e79 100644 --- a/act/runner/runner_test.go +++ b/act/runner/runner_test.go @@ -18,8 +18,8 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" "github.com/joho/godotenv" log "github.com/sirupsen/logrus" diff --git a/act/runner/step.go b/act/runner/step.go index 71049684..30155a38 100644 --- a/act/runner/step.go +++ b/act/runner/step.go @@ -13,10 +13,10 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/exprparser" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/exprparser" + "gitea.com/gitea/runner/v3/act/model" ) type step interface { diff --git a/act/runner/step_action_local.go b/act/runner/step_action_local.go index dd0884a6..2518af61 100644 --- a/act/runner/step_action_local.go +++ b/act/runner/step_action_local.go @@ -15,8 +15,8 @@ import ( "path" "path/filepath" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" ) type stepActionLocal struct { diff --git a/act/runner/step_action_local_test.go b/act/runner/step_action_local_test.go index a17711ae..e3035c0c 100644 --- a/act/runner/step_action_local_test.go +++ b/act/runner/step_action_local_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_action_remote.go b/act/runner/step_action_remote.go index f063244c..5b011fab 100644 --- a/act/runner/step_action_remote.go +++ b/act/runner/step_action_remote.go @@ -16,9 +16,9 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/model" gogit "github.com/go-git/go-git/v5" ) diff --git a/act/runner/step_action_remote_test.go b/act/runner/step_action_remote_test.go index 473cbb62..7dc06e9a 100644 --- a/act/runner/step_action_remote_test.go +++ b/act/runner/step_action_remote_test.go @@ -17,9 +17,9 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_docker.go b/act/runner/step_docker.go index a0b9edc6..3ee6b687 100644 --- a/act/runner/step_docker.go +++ b/act/runner/step_docker.go @@ -9,9 +9,9 @@ import ( "fmt" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/step_docker_test.go b/act/runner/step_docker_test.go index 2aac21f3..64adcbe2 100644 --- a/act/runner/step_docker_test.go +++ b/act/runner/step_docker_test.go @@ -11,8 +11,8 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_factory.go b/act/runner/step_factory.go index af77ca56..6bf0c081 100644 --- a/act/runner/step_factory.go +++ b/act/runner/step_factory.go @@ -7,7 +7,7 @@ package runner import ( "fmt" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" ) type stepFactory interface { diff --git a/act/runner/step_factory_test.go b/act/runner/step_factory_test.go index f428820d..75ce72f4 100644 --- a/act/runner/step_factory_test.go +++ b/act/runner/step_factory_test.go @@ -7,7 +7,7 @@ package runner import ( "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/runner/step_run.go b/act/runner/step_run.go index cae2a639..285c2860 100644 --- a/act/runner/step_run.go +++ b/act/runner/step_run.go @@ -12,10 +12,10 @@ import ( "slices" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/lookpath" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/lookpath" + "gitea.com/gitea/runner/v3/act/model" "github.com/kballard/go-shellquote" "github.com/sirupsen/logrus" diff --git a/act/runner/step_run_print_test.go b/act/runner/step_run_print_test.go index 988e75d2..48eec550 100644 --- a/act/runner/step_run_print_test.go +++ b/act/runner/step_run_print_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/act/runner/step_run_test.go b/act/runner/step_run_test.go index 17d569d6..6d4e9c1f 100644 --- a/act/runner/step_run_test.go +++ b/act/runner/step_run_test.go @@ -10,8 +10,8 @@ import ( "io" "testing" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/act/runner/step_test.go b/act/runner/step_test.go index 50221e78..9efa9ee0 100644 --- a/act/runner/step_test.go +++ b/act/runner/step_test.go @@ -9,8 +9,8 @@ import ( "errors" "testing" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/act/runner/toolkit_patch.go b/act/runner/toolkit_patch.go index 3a3364d3..57be51a7 100644 --- a/act/runner/toolkit_patch.go +++ b/act/runner/toolkit_patch.go @@ -11,9 +11,9 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/common/git" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/v3/act/model" ) // Actions bundle the @actions toolkit into their own JavaScript, and two of its lines keep it diff --git a/act/runner/toolkit_patch_e2e_test.go b/act/runner/toolkit_patch_e2e_test.go index c77cb43b..5bb59680 100644 --- a/act/runner/toolkit_patch_e2e_test.go +++ b/act/runner/toolkit_patch_e2e_test.go @@ -18,7 +18,7 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/artifactcache" + "gitea.com/gitea/runner/v3/act/artifactcache" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/act/runner/toolkit_patch_test.go b/act/runner/toolkit_patch_test.go index e0e44268..43a8ca25 100644 --- a/act/runner/toolkit_patch_test.go +++ b/act/runner/toolkit_patch_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/go.mod b/go.mod index 0b21a597..691a9cb5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitea.com/gitea/runner +module gitea.com/gitea/runner/v3 go 1.26.0 diff --git a/internal/app/cmd/bug_report.go b/internal/app/cmd/bug_report.go index 666e7a9f..87765e3c 100644 --- a/internal/app/cmd/bug_report.go +++ b/internal/app/cmd/bug_report.go @@ -7,7 +7,7 @@ import ( "fmt" "runtime" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "github.com/spf13/cobra" ) diff --git a/internal/app/cmd/cache-server.go b/internal/app/cmd/cache-server.go index 1d63da05..93ba31c8 100644 --- a/internal/app/cmd/cache-server.go +++ b/internal/app/cmd/cache-server.go @@ -9,8 +9,8 @@ import ( "os" "os/signal" - "gitea.com/gitea/runner/act/artifactcache" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/act/artifactcache" + "gitea.com/gitea/runner/v3/internal/pkg/config" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/internal/app/cmd/cmd.go b/internal/app/cmd/cmd.go index 4cb02420..1e04c635 100644 --- a/internal/app/cmd/cmd.go +++ b/internal/app/cmd/cmd.go @@ -7,7 +7,7 @@ import ( "context" "os" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "github.com/spf13/cobra" ) diff --git a/internal/app/cmd/config.go b/internal/app/cmd/config.go index 844281dc..16bc9570 100644 --- a/internal/app/cmd/config.go +++ b/internal/app/cmd/config.go @@ -10,7 +10,7 @@ import ( "slices" "strings" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/spf13/cobra" ) diff --git a/internal/app/cmd/config_test.go b/internal/app/cmd/config_test.go index d89961fc..46d8e13d 100644 --- a/internal/app/cmd/config_test.go +++ b/internal/app/cmd/config_test.go @@ -9,7 +9,7 @@ import ( "path/filepath" "testing" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/app/cmd/daemon.go b/internal/app/cmd/daemon.go index d1b3a69a..53c85990 100644 --- a/internal/app/cmd/daemon.go +++ b/internal/app/cmd/daemon.go @@ -16,15 +16,15 @@ import ( "strings" "time" - "gitea.com/gitea/runner/internal/app/poll" - "gitea.com/gitea/runner/internal/app/run" - "gitea.com/gitea/runner/internal/pkg/client" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/envcheck" - "gitea.com/gitea/runner/internal/pkg/labels" - "gitea.com/gitea/runner/internal/pkg/lock" - "gitea.com/gitea/runner/internal/pkg/metrics" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/app/poll" + "gitea.com/gitea/runner/v3/internal/app/run" + "gitea.com/gitea/runner/v3/internal/pkg/client" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/envcheck" + "gitea.com/gitea/runner/v3/internal/pkg/labels" + "gitea.com/gitea/runner/v3/internal/pkg/lock" + "gitea.com/gitea/runner/v3/internal/pkg/metrics" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "connectrpc.com/connect" "github.com/mattn/go-isatty" diff --git a/internal/app/cmd/daemon_test.go b/internal/app/cmd/daemon_test.go index 215b6127..6c48e8c2 100644 --- a/internal/app/cmd/daemon_test.go +++ b/internal/app/cmd/daemon_test.go @@ -6,7 +6,7 @@ package cmd import ( "testing" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" diff --git a/internal/app/cmd/exec.go b/internal/app/cmd/exec.go index 5421b120..7af72851 100644 --- a/internal/app/cmd/exec.go +++ b/internal/app/cmd/exec.go @@ -17,12 +17,12 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/artifactcache" - "gitea.com/gitea/runner/act/artifacts" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/model" - "gitea.com/gitea/runner/act/runner" - "gitea.com/gitea/runner/internal/app/run" + "gitea.com/gitea/runner/v3/act/artifactcache" + "gitea.com/gitea/runner/v3/act/artifacts" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/v3/act/runner" + "gitea.com/gitea/runner/v3/internal/app/run" "github.com/joho/godotenv" "github.com/moby/moby/api/types/container" diff --git a/internal/app/cmd/exec_test.go b/internal/app/cmd/exec_test.go index b3ce7c49..23dd72c7 100644 --- a/internal/app/cmd/exec_test.go +++ b/internal/app/cmd/exec_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" "github.com/stretchr/testify/require" "go.yaml.in/yaml/v4" diff --git a/internal/app/cmd/register.go b/internal/app/cmd/register.go index 1203a849..5418caf8 100644 --- a/internal/app/cmd/register.go +++ b/internal/app/cmd/register.go @@ -14,12 +14,12 @@ import ( "strings" "time" - "gitea.com/gitea/runner/internal/app/run" - "gitea.com/gitea/runner/internal/pkg/client" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/labels" - "gitea.com/gitea/runner/internal/pkg/lock" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/app/run" + "gitea.com/gitea/runner/v3/internal/pkg/client" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/labels" + "gitea.com/gitea/runner/v3/internal/pkg/lock" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "connectrpc.com/connect" pingv1 "gitea.dev/actions-proto-go/ping/v1" diff --git a/internal/app/cmd/register_test.go b/internal/app/cmd/register_test.go index 72b22495..991a2b49 100644 --- a/internal/app/cmd/register_test.go +++ b/internal/app/cmd/register_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" diff --git a/internal/app/poll/poller.go b/internal/app/poll/poller.go index b41d3ceb..ad67ed28 100644 --- a/internal/app/poll/poller.go +++ b/internal/app/poll/poller.go @@ -12,9 +12,9 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/runner/internal/pkg/client" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/metrics" + "gitea.com/gitea/runner/v3/internal/pkg/client" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/metrics" "connectrpc.com/connect" runnerv1 "gitea.dev/actions-proto-go/runner/v1" diff --git a/internal/app/poll/poller_test.go b/internal/app/poll/poller_test.go index cb28ba67..65986705 100644 --- a/internal/app/poll/poller_test.go +++ b/internal/app/poll/poller_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "gitea.com/gitea/runner/internal/pkg/client/mocks" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/client/mocks" + "gitea.com/gitea/runner/v3/internal/pkg/config" connect_go "connectrpc.com/connect" runnerv1 "gitea.dev/actions-proto-go/runner/v1" diff --git a/internal/app/run/disk_test.go b/internal/app/run/disk_test.go index 07851a9c..f6749b4b 100644 --- a/internal/app/run/disk_test.go +++ b/internal/app/run/disk_test.go @@ -6,7 +6,7 @@ package run import ( "testing" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/app/run/health_check.go b/internal/app/run/health_check.go index 5b00ee50..e5c8d67e 100644 --- a/internal/app/run/health_check.go +++ b/internal/app/run/health_check.go @@ -14,8 +14,8 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/internal/pkg/process" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/internal/pkg/process" ) func (r *Runner) checkConfiguredHealth(ctx context.Context) (bool, string) { diff --git a/internal/app/run/health_check_test.go b/internal/app/run/health_check_test.go index f6e09673..0e5a396e 100644 --- a/internal/app/run/health_check_test.go +++ b/internal/app/run/health_check_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/app/run/post_task_script.go b/internal/app/run/post_task_script.go index d0688831..3a2aec3a 100644 --- a/internal/app/run/post_task_script.go +++ b/internal/app/run/post_task_script.go @@ -13,11 +13,11 @@ import ( "strings" "time" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/metrics" - "gitea.com/gitea/runner/internal/pkg/process" - "gitea.com/gitea/runner/internal/pkg/report" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/metrics" + "gitea.com/gitea/runner/v3/internal/pkg/process" + "gitea.com/gitea/runner/v3/internal/pkg/report" runnerv1 "gitea.dev/actions-proto-go/runner/v1" log "github.com/sirupsen/logrus" diff --git a/internal/app/run/post_task_script_test.go b/internal/app/run/post_task_script_test.go index ae7e2eeb..24c3b38f 100644 --- a/internal/app/run/post_task_script_test.go +++ b/internal/app/run/post_task_script_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/metrics" - "gitea.com/gitea/runner/internal/pkg/report" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/metrics" + "gitea.com/gitea/runner/v3/internal/pkg/report" runnerv1 "gitea.dev/actions-proto-go/runner/v1" log "github.com/sirupsen/logrus" diff --git a/internal/app/run/proxy.go b/internal/app/run/proxy.go index 125458bb..2abe5afe 100644 --- a/internal/app/run/proxy.go +++ b/internal/app/run/proxy.go @@ -10,7 +10,7 @@ import ( "slices" "strings" - "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/v3/act/container" log "github.com/sirupsen/logrus" "golang.org/x/net/http/httpproxy" diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 1c7d05cc..4fa076e7 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -21,17 +21,17 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/runner/act/artifactcache" - "gitea.com/gitea/runner/act/common" - "gitea.com/gitea/runner/act/container" - "gitea.com/gitea/runner/act/model" - "gitea.com/gitea/runner/act/runner" - "gitea.com/gitea/runner/internal/pkg/client" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/labels" - "gitea.com/gitea/runner/internal/pkg/metrics" - "gitea.com/gitea/runner/internal/pkg/report" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/act/artifactcache" + "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/v3/act/runner" + "gitea.com/gitea/runner/v3/internal/pkg/client" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/labels" + "gitea.com/gitea/runner/v3/internal/pkg/metrics" + "gitea.com/gitea/runner/v3/internal/pkg/report" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "connectrpc.com/connect" runnerv1 "gitea.dev/actions-proto-go/runner/v1" diff --git a/internal/app/run/runner_cache_test.go b/internal/app/run/runner_cache_test.go index 083728b1..76d885b7 100644 --- a/internal/app/run/runner_cache_test.go +++ b/internal/app/run/runner_cache_test.go @@ -14,8 +14,8 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/artifactcache" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/act/artifactcache" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/app/run/runner_idle_cleanup_test.go b/internal/app/run/runner_idle_cleanup_test.go index 0a56b505..3f30ce6e 100644 --- a/internal/app/run/runner_idle_cleanup_test.go +++ b/internal/app/run/runner_idle_cleanup_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/app/run/runner_test.go b/internal/app/run/runner_test.go index d262a3a2..99fbbe59 100644 --- a/internal/app/run/runner_test.go +++ b/internal/app/run/runner_test.go @@ -9,10 +9,10 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/act/runner" - clientmocks "gitea.com/gitea/runner/internal/pkg/client/mocks" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/act/runner" + clientmocks "gitea.com/gitea/runner/v3/internal/pkg/client/mocks" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "connectrpc.com/connect" runnerv1 "gitea.dev/actions-proto-go/runner/v1" diff --git a/internal/app/run/setup.go b/internal/app/run/setup.go index d4806d5c..0e97bc12 100644 --- a/internal/app/run/setup.go +++ b/internal/app/run/setup.go @@ -10,8 +10,8 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/internal/pkg/report" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/pkg/report" + "gitea.com/gitea/runner/v3/internal/pkg/ver" runnerv1 "gitea.dev/actions-proto-go/runner/v1" ) diff --git a/internal/app/run/setup_test.go b/internal/app/run/setup_test.go index 9ef00d83..19531d07 100644 --- a/internal/app/run/setup_test.go +++ b/internal/app/run/setup_test.go @@ -10,8 +10,8 @@ import ( "runtime" "testing" - "gitea.com/gitea/runner/internal/pkg/labels" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/pkg/labels" + "gitea.com/gitea/runner/v3/internal/pkg/ver" runnerv1 "gitea.dev/actions-proto-go/runner/v1" "github.com/stretchr/testify/assert" diff --git a/internal/app/run/workflow.go b/internal/app/run/workflow.go index 519b7fa3..e82c7b3f 100644 --- a/internal/app/run/workflow.go +++ b/internal/app/run/workflow.go @@ -9,7 +9,7 @@ import ( "sort" "strings" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" runnerv1 "gitea.dev/actions-proto-go/runner/v1" "go.yaml.in/yaml/v4" diff --git a/internal/app/run/workflow_test.go b/internal/app/run/workflow_test.go index 52d3f9d4..87a282aa 100644 --- a/internal/app/run/workflow_test.go +++ b/internal/app/run/workflow_test.go @@ -6,7 +6,7 @@ package run import ( "testing" - "gitea.com/gitea/runner/act/model" + "gitea.com/gitea/runner/v3/act/model" runnerv1 "gitea.dev/actions-proto-go/runner/v1" "github.com/stretchr/testify/require" diff --git a/internal/pkg/client/http.go b/internal/pkg/client/http.go index 6a837568..a2b03d29 100644 --- a/internal/pkg/client/http.go +++ b/internal/pkg/client/http.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "gitea.com/gitea/runner/internal/pkg/ver" + "gitea.com/gitea/runner/v3/internal/pkg/ver" "connectrpc.com/connect" "gitea.dev/actions-proto-go/ping/v1/pingv1connect" diff --git a/internal/pkg/report/reporter.go b/internal/pkg/report/reporter.go index 951811e8..ab508a65 100644 --- a/internal/pkg/report/reporter.go +++ b/internal/pkg/report/reporter.go @@ -13,10 +13,10 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/runner/act/runner" - "gitea.com/gitea/runner/internal/pkg/client" - "gitea.com/gitea/runner/internal/pkg/config" - "gitea.com/gitea/runner/internal/pkg/metrics" + "gitea.com/gitea/runner/v3/act/runner" + "gitea.com/gitea/runner/v3/internal/pkg/client" + "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/v3/internal/pkg/metrics" "connectrpc.com/connect" runnerv1 "gitea.dev/actions-proto-go/runner/v1" diff --git a/internal/pkg/report/reporter_test.go b/internal/pkg/report/reporter_test.go index 28ac36e6..645ccb31 100644 --- a/internal/pkg/report/reporter_test.go +++ b/internal/pkg/report/reporter_test.go @@ -16,9 +16,9 @@ import ( "testing" "time" - "gitea.com/gitea/runner/act/runner" - "gitea.com/gitea/runner/internal/pkg/client/mocks" - "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/v3/act/runner" + "gitea.com/gitea/runner/v3/internal/pkg/client/mocks" + "gitea.com/gitea/runner/v3/internal/pkg/config" connect_go "connectrpc.com/connect" runnerv1 "gitea.dev/actions-proto-go/runner/v1" diff --git a/internal/pkg/ver/version.go b/internal/pkg/ver/version.go index c86157cd..c4b564b4 100644 --- a/internal/pkg/ver/version.go +++ b/internal/pkg/ver/version.go @@ -3,9 +3,17 @@ package ver -// go build -ldflags "-X gitea.com/gitea/runner/internal/pkg/ver.version=1.2.3" -var version = "dev" +import "runtime/debug" + +// version is a fallback for builds without a VCS stamp, such as from a source tarball +var version string func Version() string { - return version + if version != "" { + return version + } + if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "" && info.Main.Version != "(devel)" { + return info.Main.Version + } + return "dev" } diff --git a/internal/pkg/ver/version_test.go b/internal/pkg/ver/version_test.go index 54429176..a8187831 100644 --- a/internal/pkg/ver/version_test.go +++ b/internal/pkg/ver/version_test.go @@ -6,7 +6,12 @@ package ver import "testing" func TestVersion(t *testing.T) { - // version defaults to "dev" and is overridden at build time via -ldflags + if got := Version(); got == "" || got == "(devel)" { + t.Errorf("Version() = %q, want a concrete version", got) + } + + version = "1.2.3" + defer func() { version = "" }() if got := Version(); got != version { t.Errorf("Version() = %q, want %q", got, version) } diff --git a/main.go b/main.go index cd16cfaf..58eee486 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "os/signal" "syscall" - "gitea.com/gitea/runner/internal/app/cmd" + "gitea.com/gitea/runner/v3/internal/app/cmd" ) func main() { diff --git a/tools/coverage-report.ts b/tools/coverage-report.ts index 9a1cc081..0179e6e0 100644 --- a/tools/coverage-report.ts +++ b/tools/coverage-report.ts @@ -14,7 +14,7 @@ import {readFileSync, writeFileSync} from 'node:fs'; import {basename, dirname} from 'node:path'; import {argv, exit, stderr} from 'node:process'; -const modulePrefix = 'gitea.com/gitea/runner/'; +const modulePrefix = 'gitea.com/gitea/runner/v3/'; type Counter = { covered: number;