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

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