diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c059efd3..9db7834e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,7 @@ jobs: build_windows: runs-on: windows-latest + if: startsWith(github.ref, 'refs/tags/') steps: - name: Checkout uses: actions/checkout@v4 @@ -177,3 +178,31 @@ jobs: one-api.exe one-api-${{ env.SHORT_SHA }}.exe retention-days: 90 + + create_release: + needs: [build_windows] + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Extract version + id: extract_version + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - 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: Download Windows artifacts + uses: actions/download-artifact@v4 + with: + name: one-api-windows + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + name: Release ${{ steps.extract_version.outputs.VERSION }} + files: | + one-api.exe + one-api-${{ env.SHORT_SHA }}.exe + draft: false + prerelease: false diff --git a/go.mod b/go.mod index f00504b4..23055c99 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,8 @@ toolchain go1.24.0 require ( cloud.google.com/go/iam v1.4.0 github.com/Laisky/gin-middlewares/v6 v6.0.0 - github.com/Laisky/go-utils/v5 v5.0.0 + github.com/Laisky/go-utils/v5 v5.0.1-0.20250228054950-e1500acd6929 + github.com/Laisky/zap v1.27.1-0.20241010063010-3154c45f2a1f github.com/aws/aws-sdk-go-v2 v1.36.2 github.com/aws/aws-sdk-go-v2/credentials v1.17.60 github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.24.6 @@ -51,7 +52,6 @@ require ( github.com/Laisky/golang-fifo v1.0.1-0.20240403091456-fc83d5e38c0b // indirect github.com/Laisky/graphql v1.0.6 // indirect github.com/Laisky/pprof v0.0.0-20231102060718-a7a7fd2965ee // indirect - github.com/Laisky/zap v1.27.1-0.20241010063010-3154c45f2a1f // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.33 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.33 // indirect diff --git a/go.sum b/go.sum index 85fdee73..fce5899a 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,8 @@ github.com/Laisky/go-chaining v0.0.0-20180507092046-43dcdc5a21be h1:7Rxhm6IjOtDA github.com/Laisky/go-chaining v0.0.0-20180507092046-43dcdc5a21be/go.mod h1:1mdzaETo0kjvCQICPSePsoaatJN4l7JvEA1200lyevo= github.com/Laisky/go-gin-prometheus v1.0.1 h1:0xxZ0SeuycO65sQyZpwVCr19blGtkbwv39pQrw+hrWo= github.com/Laisky/go-gin-prometheus v1.0.1/go.mod h1:3yC0gDd4f79ikEM1eGHLTWSRG0tluOV2mmx/liYLtIA= -github.com/Laisky/go-utils/v5 v5.0.0 h1:Cn7Xy3nnWI9bOZpiZ+msRM9953AneXDTqaFAwIzXM2Y= -github.com/Laisky/go-utils/v5 v5.0.0/go.mod h1:4v7RGRQvvECSiuND4d1N3sW09A+GcclZUHQnbAkX+T0= +github.com/Laisky/go-utils/v5 v5.0.1-0.20250228054950-e1500acd6929 h1:xAvviiCg/4ohZi0y4N8jTmZMIIuZAnt7zxpFKt580uw= +github.com/Laisky/go-utils/v5 v5.0.1-0.20250228054950-e1500acd6929/go.mod h1:4v7RGRQvvECSiuND4d1N3sW09A+GcclZUHQnbAkX+T0= github.com/Laisky/golang-fifo v1.0.1-0.20240403091456-fc83d5e38c0b h1:o2BuVyXFkDTkEiuz1Ur32jGvaErgEHqhb8AtTIkrvE0= github.com/Laisky/golang-fifo v1.0.1-0.20240403091456-fc83d5e38c0b/go.mod h1:j90tUqwBaEncIzpAd6ZGPZHWjclgAyMY8fdOqsewitE= github.com/Laisky/graphql v1.0.6 h1:NEULGxfxo+wbsW2OmqBXOMNUGgqo8uFjWNabwuNK10g=