ci: regenerate go.sum at build time (proxy cache inconsistency)

This commit is contained in:
2026-05-05 21:34:05 -07:00
parent bcc185c186
commit 7ff22b0f57
2 changed files with 12 additions and 2 deletions
+8 -1
View File
@@ -20,7 +20,10 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod download
- name: Refresh go.sum (proxy cache inconsistency)
run: rm -f go.sum && GOSUMDB=off go mod download
env:
GOSUMDB: "off"
- run: go test -race -count=1 ./...
env:
CGO_ENABLED: 1
@@ -34,5 +37,9 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Refresh go.sum (proxy cache inconsistency)
run: rm -f go.sum && GOSUMDB=off go mod download
env:
GOSUMDB: "off"
- run: go vet ./...
- run: test -z "$(gofmt -l .)"
+4 -1
View File
@@ -4,7 +4,10 @@ FROM golang:1.26-alpine AS builder
RUN apk add --no-cache gcc musl-dev sqlite-dev
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
# proxy.golang.org has inconsistent caching for hanzoai/[email protected]
# (different POPs serve different zip hashes). Regenerate go.sum from the
# proxy state we actually see at build time and skip sum.golang.org.
RUN rm -f go.sum && GOSUMDB=off go mod download
COPY . .
ARG VERSION=dev
RUN CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux go build \