From 24c13a1fd0cac7981c0bb6af4aeeedb03f44ff46 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 6 Aug 2026 21:50:21 +0000 Subject: [PATCH] chore: revert 4c2ab943a8b85f940ce7e0a4cff23e852cee02c5 (#1148) Revert #1136 and use actionslib instead. revert 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 Reviewed-on: https://gitea.com/gitea/runner/pulls/1148 Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com> --- .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, 223 insertions(+), 226 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9c1d9bd9..d6e454e5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -65,7 +65,7 @@ builds: flags: - -trimpath ldflags: - - -s -w + - -s -w -X gitea.com/gitea/runner/internal/pkg/ver.version={{ .Summary }} binary: >- {{ .ProjectName }}- {{- .Version }}- diff --git a/Makefile b/Makefile index 97215f84..10b83389 100644 --- a/Makefile +++ b/Makefile @@ -51,18 +51,28 @@ 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 ?= +LDFLAGS ?= -X "gitea.com/gitea/runner/internal/pkg/ver.version=v$(RELASE_VERSION)" .PHONY: all all: build diff --git a/act/artifactcache/handler.go b/act/artifactcache/handler.go index 6bad186b..3cf2174a 100644 --- a/act/artifactcache/handler.go +++ b/act/artifactcache/handler.go @@ -26,7 +26,7 @@ import ( "sync/atomic" "time" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/act/common" "github.com/julienschmidt/httprouter" "github.com/sirupsen/logrus" diff --git a/act/artifacts/server.go b/act/artifacts/server.go index f0451825..fb4e8b6b 100644 --- a/act/artifacts/server.go +++ b/act/artifacts/server.go @@ -17,7 +17,7 @@ import ( "strings" "time" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/act/common" "github.com/julienschmidt/httprouter" ) diff --git a/act/common/git/git.go b/act/common/git/git.go index 0dab5d03..fab65532 100644 --- a/act/common/git/git.go +++ b/act/common/git/git.go @@ -15,8 +15,8 @@ import ( "strings" "sync" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/internal/pkg/lock" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 53389670..6984130e 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/v3/act/common" + "gitea.com/gitea/runner/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 7ffc2e4c..f4df9700 100644 --- a/act/container/container_types.go +++ b/act/container/container_types.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/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 dc344aae..8f5f2fa8 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/v3/act/common" + "gitea.com/gitea/runner/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 fadf3ac8..2e072252 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/v3/act/common" + "gitea.com/gitea/runner/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 3201b322..406d1907 100644 --- a/act/container/docker_network.go +++ b/act/container/docker_network.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/act/common" "github.com/moby/moby/client" ) diff --git a/act/container/docker_pull.go b/act/container/docker_pull.go index 51184ff4..3204dcc1 100644 --- a/act/container/docker_pull.go +++ b/act/container/docker_pull.go @@ -11,7 +11,7 @@ import ( "fmt" "strings" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/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 8f3d7a90..1db35b67 100644 --- a/act/container/docker_run.go +++ b/act/container/docker_run.go @@ -23,8 +23,8 @@ import ( "strings" "time" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/filecollector" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 62528bb9..d6a60d47 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/v3/act/common" + "gitea.com/gitea/runner/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 9ba332c9..0db4febe 100644 --- a/act/container/docker_stub.go +++ b/act/container/docker_stub.go @@ -12,7 +12,7 @@ import ( "runtime" "time" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/act/common" "github.com/moby/moby/api/types/system" ) diff --git a/act/container/docker_volume.go b/act/container/docker_volume.go index b871d55b..30046ea7 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/v3/act/common" + "gitea.com/gitea/runner/act/common" "github.com/moby/moby/client" ) diff --git a/act/container/host_environment.go b/act/container/host_environment.go index 225a6650..f963cb70 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/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" + "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" "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 73eac4d5..2f5d1c5e 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/v3/act/common" + "gitea.com/gitea/runner/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 e4d4349f..ec8f1545 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/v3/act/common" + "gitea.com/gitea/runner/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 b9bb5e20..7987273b 100644 --- a/act/exprparser/functions.go +++ b/act/exprparser/functions.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/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 b827df2d..b380f586 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/v3/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/exprparser/interpreter.go b/act/exprparser/interpreter.go index ee3d1e67..4bed3e85 100644 --- a/act/exprparser/interpreter.go +++ b/act/exprparser/interpreter.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/model" "github.com/rhysd/actionlint" ) diff --git a/act/exprparser/interpreter_test.go b/act/exprparser/interpreter_test.go index 4828ba83..4d25dcc1 100644 --- a/act/exprparser/interpreter_test.go +++ b/act/exprparser/interpreter_test.go @@ -9,7 +9,7 @@ import ( "reflect" "testing" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/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 c3d3d024..c70fb240 100644 --- a/act/model/github_context.go +++ b/act/model/github_context.go @@ -9,8 +9,8 @@ import ( "fmt" "strings" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/common/git" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" ) type GithubContext struct { diff --git a/act/model/workflow.go b/act/model/workflow.go index 59527bba..0b4370b4 100644 --- a/act/model/workflow.go +++ b/act/model/workflow.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/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 1b856ae1..da2e811a 100644 --- a/act/runner/action.go +++ b/act/runner/action.go @@ -20,10 +20,10 @@ import ( "runtime" "strings" - "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" + "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" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/action_cache_test.go b/act/runner/action_cache_test.go index 846f168b..5b185964 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 6aa5ec06..bdbc4eeb 100644 --- a/act/runner/action_composite.go +++ b/act/runner/action_composite.go @@ -12,8 +12,8 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 725c5cfb..eb068881 100644 --- a/act/runner/action_test.go +++ b/act/runner/action_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - "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" + "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" "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 75c28859..add340ce 100644 --- a/act/runner/cancellation_test.go +++ b/act/runner/cancellation_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/exprparser" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/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 a6903f69..ef8fc836 100644 --- a/act/runner/command.go +++ b/act/runner/command.go @@ -10,7 +10,7 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/act/common" ) var commandPatternGA *regexp.Regexp diff --git a/act/runner/command_test.go b/act/runner/command_test.go index 172fe556..16cdb5a4 100644 --- a/act/runner/command_test.go +++ b/act/runner/command_test.go @@ -11,8 +11,8 @@ import ( "os" "testing" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 fe514240..8a56b26f 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" "github.com/stretchr/testify/mock" ) diff --git a/act/runner/expression.go b/act/runner/expression.go index 5945d9bb..c382ea15 100644 --- a/act/runner/expression.go +++ b/act/runner/expression.go @@ -16,10 +16,10 @@ import ( "strings" "time" - "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/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" _ "embed" diff --git a/act/runner/expression_test.go b/act/runner/expression_test.go index 2962b606..13719e4c 100644 --- a/act/runner/expression_test.go +++ b/act/runner/expression_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "gitea.com/gitea/runner/v3/act/exprparser" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/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 ae76534a..40434dfa 100644 --- a/act/runner/helpers_test.go +++ b/act/runner/helpers_test.go @@ -9,7 +9,7 @@ import ( "runtime" "testing" - "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/act/container" mobyclient "github.com/moby/moby/client" ) diff --git a/act/runner/job_executor.go b/act/runner/job_executor.go index 4e06a47b..2559ac83 100644 --- a/act/runner/job_executor.go +++ b/act/runner/job_executor.go @@ -21,10 +21,10 @@ import ( "time" "unicode" - "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/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" ) const maxJobSummaryBytes = 1024 * 1024 diff --git a/act/runner/job_executor_test.go b/act/runner/job_executor_test.go index 618650d5..6247c6eb 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/container" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/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 847245da..e39ee739 100644 --- a/act/runner/job_hooks.go +++ b/act/runner/job_hooks.go @@ -11,8 +11,8 @@ import ( "path" "strings" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 6294727b..51ec4fc8 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 e76630c6..d8e1ebad 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/v3/act/filecollector" + "gitea.com/gitea/runner/act/filecollector" ) type LocalRepositoryCache struct { diff --git a/act/runner/logger.go b/act/runner/logger.go index e0caba90..615fc0e4 100644 --- a/act/runner/logger.go +++ b/act/runner/logger.go @@ -17,7 +17,7 @@ import ( "strings" "sync" - "gitea.com/gitea/runner/v3/act/common" + "gitea.com/gitea/runner/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 aa10b2ca..aba5d980 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/v3/act/model" + "gitea.com/gitea/runner/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 b1da9d02..00e98027 100644 --- a/act/runner/reusable_workflow.go +++ b/act/runner/reusable_workflow.go @@ -14,9 +14,9 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/common/git" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/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 2cd5a9c9..401ee39d 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/v3/act/common/git" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/require" ) diff --git a/act/runner/run_context.go b/act/runner/run_context.go index 2fc868c5..1b0c1a35 100644 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "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" + "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" "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 367a720b..962c7704 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/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/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/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 dfee3bb0..1eaddccb 100644 --- a/act/runner/runner.go +++ b/act/runner/runner.go @@ -14,9 +14,9 @@ import ( "sync" "time" - "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/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/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 f3f90e79..922c0f02 100644 --- a/act/runner/runner_test.go +++ b/act/runner/runner_test.go @@ -18,8 +18,8 @@ import ( "testing" "time" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" "github.com/joho/godotenv" log "github.com/sirupsen/logrus" diff --git a/act/runner/step.go b/act/runner/step.go index 30155a38..71049684 100644 --- a/act/runner/step.go +++ b/act/runner/step.go @@ -13,10 +13,10 @@ import ( "strings" "time" - "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/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/exprparser" + "gitea.com/gitea/runner/act/model" ) type step interface { diff --git a/act/runner/step_action_local.go b/act/runner/step_action_local.go index 2518af61..dd0884a6 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/model" ) type stepActionLocal struct { diff --git a/act/runner/step_action_local_test.go b/act/runner/step_action_local_test.go index e3035c0c..a17711ae 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 5b011fab..f063244c 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/common/git" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/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 7dc06e9a..473cbb62 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/common/git" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/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 3ee6b687..a0b9edc6 100644 --- a/act/runner/step_docker.go +++ b/act/runner/step_docker.go @@ -9,9 +9,9 @@ import ( "fmt" "strings" - "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/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/model" "github.com/kballard/go-shellquote" ) diff --git a/act/runner/step_docker_test.go b/act/runner/step_docker_test.go index 64adcbe2..2aac21f3 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/v3/act/container" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/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 6bf0c081..af77ca56 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/v3/act/model" + "gitea.com/gitea/runner/act/model" ) type stepFactory interface { diff --git a/act/runner/step_factory_test.go b/act/runner/step_factory_test.go index 75ce72f4..f428820d 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/v3/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" ) diff --git a/act/runner/step_run.go b/act/runner/step_run.go index 285c2860..cae2a639 100644 --- a/act/runner/step_run.go +++ b/act/runner/step_run.go @@ -12,10 +12,10 @@ import ( "slices" "strings" - "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" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/act/lookpath" + "gitea.com/gitea/runner/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 48eec550..988e75d2 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/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 6d4e9c1f..17d569d6 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/v3/act/container" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/container" + "gitea.com/gitea/runner/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 9efa9ee0..50221e78 100644 --- a/act/runner/step_test.go +++ b/act/runner/step_test.go @@ -9,8 +9,8 @@ import ( "errors" "testing" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 57be51a7..3a3364d3 100644 --- a/act/runner/toolkit_patch.go +++ b/act/runner/toolkit_patch.go @@ -11,9 +11,9 @@ import ( "regexp" "strings" - "gitea.com/gitea/runner/v3/act/common" - "gitea.com/gitea/runner/v3/act/common/git" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/act/common/git" + "gitea.com/gitea/runner/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 5bb59680..c77cb43b 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/v3/act/artifactcache" + "gitea.com/gitea/runner/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 43a8ca25..e0e44268 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/v3/act/model" + "gitea.com/gitea/runner/act/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/go.mod b/go.mod index 691a9cb5..0b21a597 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitea.com/gitea/runner/v3 +module gitea.com/gitea/runner go 1.26.0 diff --git a/internal/app/cmd/bug_report.go b/internal/app/cmd/bug_report.go index 87765e3c..666e7a9f 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/v3/internal/pkg/ver" + "gitea.com/gitea/runner/internal/pkg/ver" "github.com/spf13/cobra" ) diff --git a/internal/app/cmd/cache-server.go b/internal/app/cmd/cache-server.go index 93ba31c8..1d63da05 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/v3/act/artifactcache" - "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/act/artifactcache" + "gitea.com/gitea/runner/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 1e04c635..4cb02420 100644 --- a/internal/app/cmd/cmd.go +++ b/internal/app/cmd/cmd.go @@ -7,7 +7,7 @@ import ( "context" "os" - "gitea.com/gitea/runner/v3/internal/pkg/ver" + "gitea.com/gitea/runner/internal/pkg/ver" "github.com/spf13/cobra" ) diff --git a/internal/app/cmd/config.go b/internal/app/cmd/config.go index 16bc9570..844281dc 100644 --- a/internal/app/cmd/config.go +++ b/internal/app/cmd/config.go @@ -10,7 +10,7 @@ import ( "slices" "strings" - "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/config" "github.com/spf13/cobra" ) diff --git a/internal/app/cmd/config_test.go b/internal/app/cmd/config_test.go index 46d8e13d..d89961fc 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/v3/internal/pkg/config" + "gitea.com/gitea/runner/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 53c85990..d1b3a69a 100644 --- a/internal/app/cmd/daemon.go +++ b/internal/app/cmd/daemon.go @@ -16,15 +16,15 @@ import ( "strings" "time" - "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" + "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" "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 6c48e8c2..215b6127 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/v3/internal/pkg/config" + "gitea.com/gitea/runner/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 7af72851..5421b120 100644 --- a/internal/app/cmd/exec.go +++ b/internal/app/cmd/exec.go @@ -17,12 +17,12 @@ import ( "strings" "time" - "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" + "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" "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 23dd72c7..b3ce7c49 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/v3/act/model" + "gitea.com/gitea/runner/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 5418caf8..1203a849 100644 --- a/internal/app/cmd/register.go +++ b/internal/app/cmd/register.go @@ -14,12 +14,12 @@ import ( "strings" "time" - "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" + "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" "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 991a2b49..72b22495 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/v3/internal/pkg/config" + "gitea.com/gitea/runner/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 ad67ed28..b41d3ceb 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/v3/internal/pkg/client" - "gitea.com/gitea/runner/v3/internal/pkg/config" - "gitea.com/gitea/runner/v3/internal/pkg/metrics" + "gitea.com/gitea/runner/internal/pkg/client" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/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 65986705..cb28ba67 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/v3/internal/pkg/client/mocks" - "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/client/mocks" + "gitea.com/gitea/runner/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 f6749b4b..07851a9c 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/v3/internal/pkg/config" + "gitea.com/gitea/runner/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 e5c8d67e..5b00ee50 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/v3/act/common" - "gitea.com/gitea/runner/v3/internal/pkg/process" + "gitea.com/gitea/runner/act/common" + "gitea.com/gitea/runner/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 0e5a396e..f6e09673 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/v3/internal/pkg/config" + "gitea.com/gitea/runner/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 3a2aec3a..d0688831 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/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" + "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" 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 24c3b38f..ae7e2eeb 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/v3/internal/pkg/config" - "gitea.com/gitea/runner/v3/internal/pkg/metrics" - "gitea.com/gitea/runner/v3/internal/pkg/report" + "gitea.com/gitea/runner/internal/pkg/config" + "gitea.com/gitea/runner/internal/pkg/metrics" + "gitea.com/gitea/runner/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 2abe5afe..125458bb 100644 --- a/internal/app/run/proxy.go +++ b/internal/app/run/proxy.go @@ -10,7 +10,7 @@ import ( "slices" "strings" - "gitea.com/gitea/runner/v3/act/container" + "gitea.com/gitea/runner/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 4fa076e7..1c7d05cc 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/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" + "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" "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 76d885b7..083728b1 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/v3/act/artifactcache" - "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/act/artifactcache" + "gitea.com/gitea/runner/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 3f30ce6e..0a56b505 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/v3/internal/pkg/config" + "gitea.com/gitea/runner/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 99fbbe59..d262a3a2 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/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" + "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" "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 0e97bc12..d4806d5c 100644 --- a/internal/app/run/setup.go +++ b/internal/app/run/setup.go @@ -10,8 +10,8 @@ import ( "strconv" "strings" - "gitea.com/gitea/runner/v3/internal/pkg/report" - "gitea.com/gitea/runner/v3/internal/pkg/ver" + "gitea.com/gitea/runner/internal/pkg/report" + "gitea.com/gitea/runner/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 19531d07..9ef00d83 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/v3/internal/pkg/labels" - "gitea.com/gitea/runner/v3/internal/pkg/ver" + "gitea.com/gitea/runner/internal/pkg/labels" + "gitea.com/gitea/runner/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 e82c7b3f..519b7fa3 100644 --- a/internal/app/run/workflow.go +++ b/internal/app/run/workflow.go @@ -9,7 +9,7 @@ import ( "sort" "strings" - "gitea.com/gitea/runner/v3/act/model" + "gitea.com/gitea/runner/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 87a282aa..52d3f9d4 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/v3/act/model" + "gitea.com/gitea/runner/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 a2b03d29..6a837568 100644 --- a/internal/pkg/client/http.go +++ b/internal/pkg/client/http.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "gitea.com/gitea/runner/v3/internal/pkg/ver" + "gitea.com/gitea/runner/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 ab508a65..951811e8 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/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" + "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" "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 645ccb31..28ac36e6 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/v3/act/runner" - "gitea.com/gitea/runner/v3/internal/pkg/client/mocks" - "gitea.com/gitea/runner/v3/internal/pkg/config" + "gitea.com/gitea/runner/act/runner" + "gitea.com/gitea/runner/internal/pkg/client/mocks" + "gitea.com/gitea/runner/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 c4b564b4..c86157cd 100644 --- a/internal/pkg/ver/version.go +++ b/internal/pkg/ver/version.go @@ -3,17 +3,9 @@ package ver -import "runtime/debug" - -// version is a fallback for builds without a VCS stamp, such as from a source tarball -var version string +// go build -ldflags "-X gitea.com/gitea/runner/internal/pkg/ver.version=1.2.3" +var version = "dev" func Version() string { - if version != "" { - return version - } - if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "" && info.Main.Version != "(devel)" { - return info.Main.Version - } - return "dev" + return version } diff --git a/internal/pkg/ver/version_test.go b/internal/pkg/ver/version_test.go index a8187831..54429176 100644 --- a/internal/pkg/ver/version_test.go +++ b/internal/pkg/ver/version_test.go @@ -6,12 +6,7 @@ package ver import "testing" func TestVersion(t *testing.T) { - if got := Version(); got == "" || got == "(devel)" { - t.Errorf("Version() = %q, want a concrete version", got) - } - - version = "1.2.3" - defer func() { version = "" }() + // version defaults to "dev" and is overridden at build time via -ldflags if got := Version(); got != version { t.Errorf("Version() = %q, want %q", got, version) } diff --git a/main.go b/main.go index 58eee486..cd16cfaf 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "os/signal" "syscall" - "gitea.com/gitea/runner/v3/internal/app/cmd" + "gitea.com/gitea/runner/internal/app/cmd" ) func main() { diff --git a/tools/coverage-report.ts b/tools/coverage-report.ts index 0179e6e0..9a1cc081 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/v3/'; +const modulePrefix = 'gitea.com/gitea/runner/'; type Counter = { covered: number;