File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,3 +148,48 @@ jobs:
148148 path : hunyuan2api-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
149149 retention-days : 90
150150
151+ build-api-pool-lite :
152+ name : Build api-pool-lite
153+ runs-on : ubuntu-latest
154+ strategy :
155+ matrix :
156+ os : [windows, linux]
157+ arch : [amd64]
158+ steps :
159+ - name : Check out code
160+ uses : actions/checkout@v4
161+
162+ - name : Set up Go
163+ uses : actions/setup-go@v4
164+ with :
165+ go-version : ' 1.21'
166+ check-latest : true
167+ cache : true
168+
169+ - name : Set version
170+ id : set-version
171+ run : |
172+ echo "version=$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
173+
174+ - name : Build for ${{ matrix.os }}-${{ matrix.arch }}
175+ env :
176+ GOOS : ${{ matrix.os }}
177+ GOARCH : ${{ matrix.arch }}
178+ VERSION : ${{ steps.set-version.outputs.version }}
179+ run : |
180+ # 设置文件扩展名(Windows为.exe,其他无扩展名)
181+ if [ "${{ matrix.os }}" == "windows" ]; then
182+ EXT=".exe"
183+ else
184+ EXT=""
185+ fi
186+
187+ BINARY_NAME="api-pool-lite-${{ matrix.os }}-${{ matrix.arch }}${EXT}"
188+ go build -ldflags "-X main.AppVersion=$VERSION" -o "$BINARY_NAME" ./api-pool.go
189+
190+ - name : Upload Artifact
191+ uses : actions/upload-artifact@v4
192+ with :
193+ name : api-pool-lite-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.set-version.outputs.version }}
194+ path : api-pool-lite-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
195+ retention-days : 90
You can’t perform that action at this time.
0 commit comments