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]>
This commit is contained in:
silverwind
2026-08-06 20:05:42 +00:00
committed by silverwind
co-authored by bircni
parent 20497aaf4f
commit 4c2ab943a8
99 changed files with 226 additions and 223 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ package run
import (
"testing"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+2 -2
View File
@@ -14,8 +14,8 @@ import (
"strings"
"time"
"gitea.com/gitea/runner/act/common"
"gitea.com/gitea/runner/internal/pkg/process"
"gitea.com/gitea/runner/v3/act/common"
"gitea.com/gitea/runner/v3/internal/pkg/process"
)
func (r *Runner) checkConfiguredHealth(ctx context.Context) (bool, string) {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"testing"
"time"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+5 -5
View File
@@ -13,11 +13,11 @@ import (
"strings"
"time"
"gitea.com/gitea/runner/act/common"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/internal/pkg/metrics"
"gitea.com/gitea/runner/internal/pkg/process"
"gitea.com/gitea/runner/internal/pkg/report"
"gitea.com/gitea/runner/v3/act/common"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/metrics"
"gitea.com/gitea/runner/v3/internal/pkg/process"
"gitea.com/gitea/runner/v3/internal/pkg/report"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
log "github.com/sirupsen/logrus"
+3 -3
View File
@@ -10,9 +10,9 @@ import (
"testing"
"time"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/internal/pkg/metrics"
"gitea.com/gitea/runner/internal/pkg/report"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/metrics"
"gitea.com/gitea/runner/v3/internal/pkg/report"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
log "github.com/sirupsen/logrus"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"slices"
"strings"
"gitea.com/gitea/runner/act/container"
"gitea.com/gitea/runner/v3/act/container"
log "github.com/sirupsen/logrus"
"golang.org/x/net/http/httpproxy"
+11 -11
View File
@@ -21,17 +21,17 @@ import (
"sync/atomic"
"time"
"gitea.com/gitea/runner/act/artifactcache"
"gitea.com/gitea/runner/act/common"
"gitea.com/gitea/runner/act/container"
"gitea.com/gitea/runner/act/model"
"gitea.com/gitea/runner/act/runner"
"gitea.com/gitea/runner/internal/pkg/client"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/internal/pkg/labels"
"gitea.com/gitea/runner/internal/pkg/metrics"
"gitea.com/gitea/runner/internal/pkg/report"
"gitea.com/gitea/runner/internal/pkg/ver"
"gitea.com/gitea/runner/v3/act/artifactcache"
"gitea.com/gitea/runner/v3/act/common"
"gitea.com/gitea/runner/v3/act/container"
"gitea.com/gitea/runner/v3/act/model"
"gitea.com/gitea/runner/v3/act/runner"
"gitea.com/gitea/runner/v3/internal/pkg/client"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/labels"
"gitea.com/gitea/runner/v3/internal/pkg/metrics"
"gitea.com/gitea/runner/v3/internal/pkg/report"
"gitea.com/gitea/runner/v3/internal/pkg/ver"
"connectrpc.com/connect"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
+2 -2
View File
@@ -14,8 +14,8 @@ import (
"strings"
"testing"
"gitea.com/gitea/runner/act/artifactcache"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/v3/act/artifactcache"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"testing"
"time"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+4 -4
View File
@@ -9,10 +9,10 @@ import (
"strings"
"testing"
"gitea.com/gitea/runner/act/runner"
clientmocks "gitea.com/gitea/runner/internal/pkg/client/mocks"
"gitea.com/gitea/runner/internal/pkg/config"
"gitea.com/gitea/runner/internal/pkg/ver"
"gitea.com/gitea/runner/v3/act/runner"
clientmocks "gitea.com/gitea/runner/v3/internal/pkg/client/mocks"
"gitea.com/gitea/runner/v3/internal/pkg/config"
"gitea.com/gitea/runner/v3/internal/pkg/ver"
"connectrpc.com/connect"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"strconv"
"strings"
"gitea.com/gitea/runner/internal/pkg/report"
"gitea.com/gitea/runner/internal/pkg/ver"
"gitea.com/gitea/runner/v3/internal/pkg/report"
"gitea.com/gitea/runner/v3/internal/pkg/ver"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
)
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"runtime"
"testing"
"gitea.com/gitea/runner/internal/pkg/labels"
"gitea.com/gitea/runner/internal/pkg/ver"
"gitea.com/gitea/runner/v3/internal/pkg/labels"
"gitea.com/gitea/runner/v3/internal/pkg/ver"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
"github.com/stretchr/testify/assert"
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"sort"
"strings"
"gitea.com/gitea/runner/act/model"
"gitea.com/gitea/runner/v3/act/model"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
"go.yaml.in/yaml/v4"
+1 -1
View File
@@ -6,7 +6,7 @@ package run
import (
"testing"
"gitea.com/gitea/runner/act/model"
"gitea.com/gitea/runner/v3/act/model"
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
"github.com/stretchr/testify/require"