diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f692235..45e2c564 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,3 +144,36 @@ jobs: TARGETARCH=arm64 cache-from: type=gha # cache-to: type=gha,mode=max + + build_windows: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.24.1" + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV + shell: bash + + - name: Build Windows executables + run: | + # Build the standard executable + go build -trimpath -ldflags "-s -w -X github.com/songquanpeng/one-api/common.Version=$(cat VERSION)" -o one-api.exe + + # Make a copy with the short SHA in the name + cp one-api.exe "one-api-${{ env.SHORT_SHA }}.exe" + shell: bash + + - name: Upload Windows executables + uses: actions/upload-artifact@v4 + with: + name: one-api-windows + path: | + one-api.exe + one-api-${{ env.SHORT_SHA }}.exe + retention-days: 90 diff --git a/Dockerfile b/Dockerfile index 1bf2b189..41b1bcd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run buil DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/air & \ wait -FROM golang:1.24.0-bullseye AS builder2 +FROM golang:1.24.1-bullseye AS builder2 # Make sure to use ARG with a default value ARG TARGETARCH=amd64