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/[email protected]: 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 <[email protected]>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1136
Reviewed-by: techknowlogick <[email protected]>
Reviewed-by: bircni <[email protected]>
Co-authored-by: silverwind <[email protected]>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1148
Reviewed-by: Zettat123 <[email protected]>
This commit is contained in:
Lunny Xiao
2026-08-06 21:50:21 +00:00
co-authored by bircni silverwind
parent 4c2ab943a8
commit 24c13a1fd0
99 changed files with 223 additions and 226 deletions
+1 -1
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"
+1 -1
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"
)
+2 -2
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"
+1 -1
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"
+1 -1
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"
+1 -1
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"
+1 -1
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"
+1 -1
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"
)
+1 -1
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"
+2 -2
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"
+1 -1
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"
+1 -1
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"
)
+1 -1
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"
)
+4 -4
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"
+1 -1
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"
+1 -1
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"
+1 -1
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"
+1 -1
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"
)
+1 -1
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"
)
+1 -1
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"
+2 -2
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 {
+1 -1
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"
+4 -4
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"
)
+2 -2
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"
+2 -2
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 {
+4 -4
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"
+3 -3
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"
+1 -1
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
+2 -2
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"
+2 -2
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"
)
+4 -4
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"
+2 -2
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"
+1 -1
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"
)
+4 -4
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
+3 -3
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"
+2 -2
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.
+2 -2
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"
+1 -1
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 {
+1 -1
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"
+1 -1
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"
+3 -3
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 {
+2 -2
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"
)
+5 -5
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"
+4 -4
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"
+3 -3
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"
+2 -2
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"
+4 -4
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 {
+2 -2
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 {
+2 -2
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"
+3 -3
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"
)
+3 -3
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"
+3 -3
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"
)
+2 -2
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"
+1 -1
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 {
+1 -1
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"
)
+4 -4
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"
+2 -2
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"
+2 -2
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"
+2 -2
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"
+3 -3
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
+1 -1
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"
+1 -1
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"