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.<ts>-<sha>`. Since `release-nightly.yml` triggers on every push to `main`, splitting them would publish a nightly with a `v1` version.

---------

Co-authored-by: bircni <bircni@icloud.com>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1136
Reviewed-by: techknowlogick <9+techknowlogick@noreply.gitea.com>
Reviewed-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1148
Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com>
This commit is contained in:
Lunny Xiao
2026-08-06 21:50:21 +00:00
parent 4c2ab943a8
commit 24c13a1fd0
99 changed files with 223 additions and 226 deletions

View File

@@ -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 }}-

View File

@@ -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

View File

@@ -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"

View File

@@ -17,7 +17,7 @@ import (
"strings"
"time"
"gitea.com/gitea/runner/v3/act/common"
"gitea.com/gitea/runner/act/common"
"github.com/julienschmidt/httprouter"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -13,7 +13,7 @@ import (
"strconv"
"strings"
"gitea.com/gitea/runner/v3/act/model"
"gitea.com/gitea/runner/act/model"
"github.com/rhysd/actionlint"
)

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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"

View File

@@ -10,7 +10,7 @@ import (
"regexp"
"strings"
"gitea.com/gitea/runner/v3/act/common"
"gitea.com/gitea/runner/act/common"
)
var commandPatternGA *regexp.Regexp

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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

View File

@@ -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"

View File

@@ -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.

View File

@@ -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"

View File

@@ -16,7 +16,7 @@ import (
"path/filepath"
"strings"
"gitea.com/gitea/runner/v3/act/filecollector"
"gitea.com/gitea/runner/act/filecollector"
)
type LocalRepositoryCache struct {

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -7,7 +7,7 @@ package runner
import (
"fmt"
"gitea.com/gitea/runner/v3/act/model"
"gitea.com/gitea/runner/act/model"
)
type stepFactory interface {

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

2
go.mod
View File

@@ -1,4 +1,4 @@
module gitea.com/gitea/runner/v3
module gitea.com/gitea/runner
go 1.26.0

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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) {

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
}

View File

@@ -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)
}

View File

@@ -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() {

View File

@@ -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;