fix(ci): add vendor step for private Go module authentication
Add a vendor step that uses gitea_token to fetch private modules from gitea.develooper.com, then subsequent steps use the vendored dependencies without needing credentials.
This commit is contained in:
@@ -15,6 +15,19 @@ variables:
|
|||||||
- go-pkg:/go/pkg
|
- go-pkg:/go/pkg
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: vendor
|
||||||
|
image: golang:1.26
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
GOMODCACHE: /go/pkg/mod
|
||||||
|
GOCACHE: /go/pkg/cache
|
||||||
|
volumes: *go_volumes
|
||||||
|
secrets: [gitea_token]
|
||||||
|
commands:
|
||||||
|
- printf "machine gitea.develooper.com\nlogin __token__\npassword $GITEA_TOKEN\n" > ~/.netrc
|
||||||
|
- go mod vendor
|
||||||
|
- rm -f ~/.netrc
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: golang:1.26
|
image: golang:1.26
|
||||||
pull: true
|
pull: true
|
||||||
@@ -23,6 +36,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- go test -v ./...
|
- go test -v ./...
|
||||||
- go build ./...
|
- go build ./...
|
||||||
|
depends_on: [vendor]
|
||||||
|
|
||||||
- name: goreleaser
|
- name: goreleaser
|
||||||
image: golang:1.26
|
image: golang:1.26
|
||||||
|
|||||||
Reference in New Issue
Block a user