mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 10:13:42 +08:00
ci: add Windows build workflow and update Go version to 1.24.1
This commit is contained in:
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -144,3 +144,36 @@ jobs:
|
|||||||
TARGETARCH=arm64
|
TARGETARCH=arm64
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
# cache-to: type=gha,mode=max
|
# 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
|
||||||
|
|||||||
@@ -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 & \
|
DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/air & \
|
||||||
wait
|
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
|
# Make sure to use ARG with a default value
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH=amd64
|
||||||
|
|||||||
Reference in New Issue
Block a user