mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-12-01 17:43:16 +00:00
up test.yml
This commit is contained in:
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -28,7 +28,10 @@ jobs:
|
||||
with:
|
||||
go-version: '1.22' # 选择 Go 版本
|
||||
- name: install gcc zip
|
||||
run: sudo apt-get install gcc-mingw-w64-x86-64 zip -y
|
||||
run: |
|
||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||
sudo apt-get install gcc-mingw-w64-x86-64 zip -y
|
||||
fi
|
||||
|
||||
- name: tidy
|
||||
run: go mod tidy
|
||||
@@ -48,11 +51,10 @@ jobs:
|
||||
mkdir -p release/runtime
|
||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||
CC=x86_64-w64-mingw32-gcc GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=1 go build -o ./release/apimain.exe ./cmd/apimain.go
|
||||
cd release
|
||||
zip -r ../${{ matrix.goos}}-${{ matrix.goarch }}.zip .
|
||||
zip -r ${{ matrix.goos}}-${{ matrix.goarch }}.zip ./release
|
||||
else
|
||||
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
||||
tar -czf ${{ matrix.goos}}-${{ matrix.goarch }}.tar.gz -C ./release .
|
||||
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
||||
tar -czf ${{ matrix.goos}}-${{ matrix.goarch }}.tar.gz ./release
|
||||
fi
|
||||
|
||||
- name: Upload artifact
|
||||
|
||||
Reference in New Issue
Block a user