diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e07f454..4afcfc7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,9 @@ jobs: bun run build - name: Download dependencies - run: go mod download + run: | + go version + go mod download - name: Test run: go test ./... diff --git a/.github/workflows/electron-build.yml b/.github/workflows/electron-build.yml index 5e5e1bc7..3279742a 100644 --- a/.github/workflows/electron-build.yml +++ b/.github/workflows/electron-build.yml @@ -39,7 +39,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '>=1.25.1' + go-version-file: go.mod - name: Build frontend env: @@ -63,6 +63,7 @@ jobs: run: | go mod download go build -ldflags "-s -w -X 'github.com/MAX-API-Next/MAX-API/common.Version=$(git describe --tags)'" -o max-api.exe + go version -m max-api.exe - name: Update Electron version run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdbbd12a..82df0bd4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,16 +41,18 @@ jobs: - name: Set up Go uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: - go-version: '>=1.25.1' + go-version-file: go.mod - name: Build Backend (amd64) run: | go mod download go build -ldflags "-s -w -X 'github.com/MAX-API-Next/MAX-API/common.Version=$VERSION' -extldflags '-static'" -o max-api-$VERSION + go version -m "max-api-$VERSION" - name: Build Backend (arm64) run: | sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gcc-aarch64-linux-gnu CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X 'github.com/MAX-API-Next/MAX-API/common.Version=$VERSION' -extldflags '-static'" -o max-api-arm64-$VERSION + go version -m "max-api-arm64-$VERSION" - name: Generate checksums run: sha256sum max-api-* > checksums-linux.txt @@ -94,11 +96,12 @@ jobs: - name: Set up Go uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: - go-version: '>=1.25.1' + go-version-file: go.mod - name: Build Backend run: | go mod download go build -ldflags "-X 'github.com/MAX-API-Next/MAX-API/common.Version=$VERSION'" -o max-api-macos-$VERSION + go version -m "max-api-macos-$VERSION" - name: Generate checksums run: shasum -a 256 max-api-macos-* > checksums-macos.txt @@ -144,11 +147,12 @@ jobs: - name: Set up Go uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: - go-version: '>=1.25.1' + go-version-file: go.mod - name: Build Backend run: | go mod download go build -ldflags "-s -w -X 'github.com/MAX-API-Next/MAX-API/common.Version=$VERSION'" -o max-api-$VERSION.exe + go version -m "max-api-$VERSION.exe" - name: Generate checksums run: sha256sum max-api-*.exe > checksums-windows.txt diff --git a/AGENTS.md b/AGENTS.md index 81fb70bb..cbd89fcc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ This is an AI API gateway/proxy built with Go. It aggregates 40+ upstream AI pro ## Tech Stack -- **Backend**: Go 1.22+, Gin web framework, GORM v2 ORM +- **Backend**: Go 1.26.10 (security build baseline), Gin web framework, GORM v2 ORM - **Frontend**: React 19, TypeScript, Rsbuild, Base UI, Tailwind CSS - **Databases**: SQLite, MySQL, PostgreSQL (all three must be supported) - **Cache**: Redis (go-redis) + in-memory cache diff --git a/CLAUDE.md b/CLAUDE.md index 706612ce..0746fc08 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ This is an AI API gateway/proxy built with Go. It aggregates 40+ upstream AI pro ## Tech Stack -- **Backend**: Go 1.22+, Gin web framework, GORM v2 ORM +- **Backend**: Go 1.26.10 (security build baseline), Gin web framework, GORM v2 ORM - **Frontend**: React 19, TypeScript, Rsbuild, Base UI, Tailwind CSS - **Databases**: SQLite, MySQL, PostgreSQL (all three must be supported) - **Cache**: Redis (go-redis) + in-memory cache diff --git a/Dockerfile b/Dockerfile index 52cdcfe8..a118ad05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY ./VERSION . WORKDIR /build/default RUN DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat VERSION) bun run build -FROM golang:1.26.1-alpine@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039 AS builder2 +FROM golang:1.26.10-alpine@sha256:9ce231b28998b32e116927c61aa5c406183061d4f3f2d61b292c88e7f6bdf7ca AS builder2 ENV GO111MODULE=on CGO_ENABLED=0 ARG TARGETOS @@ -28,7 +28,8 @@ RUN go mod download COPY . . COPY --from=builder /build/default/dist ./web/default/dist -RUN go build -ldflags "-s -w -X 'github.com/MAX-API-Next/MAX-API/common.Version=$(cat VERSION)'" -o max-api +RUN go build -ldflags "-s -w -X 'github.com/MAX-API-Next/MAX-API/common.Version=$(cat VERSION)'" -o max-api \ + && go version -m max-api FROM debian:bookworm-slim@sha256:f06537653ac770703bc45b4b113475bd402f451e85223f0f2837acbf89ab020a diff --git a/Dockerfile.dev b/Dockerfile.dev index 4d73a766..72a14aa5 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,7 +1,7 @@ # Backend-only build for frontend development # Skips frontend build, uses a placeholder for //go:embed web/dist -FROM golang:1.26.1-alpine AS builder +FROM golang:1.26.10-alpine@sha256:9ce231b28998b32e116927c61aa5c406183061d4f3f2d61b292c88e7f6bdf7ca AS builder ENV GO111MODULE=on CGO_ENABLED=0 ARG TARGETOS @@ -19,7 +19,8 @@ COPY . . RUN mkdir -p web/default/dist && \ echo '