|
|
@@ -52,7 +52,7 @@ jobs:
|
|
52
|
52
|
swag init -g cmd/apimain.go --output docs/api --instanceName api --exclude http/controller/admin
|
|
53
|
53
|
swag init -g cmd/apimain.go --output docs/admin --instanceName admin --exclude http/controller/api
|
|
54
|
54
|
|
|
55
|
|
- - name: Build for ${{ matrix.goos }}-${{ matrix.goarch }}
|
|
|
55
|
+ - name: Build for ${{ matrix.job.goos }}-${{ matrix.job.platform }}
|
|
56
|
56
|
run: |
|
|
57
|
57
|
mkdir release -p
|
|
58
|
58
|
cp -ar resources release/
|
|
|
@@ -60,41 +60,41 @@ jobs:
|
|
60
|
60
|
cp -ar conf release/
|
|
61
|
61
|
mkdir -p release/data
|
|
62
|
62
|
mkdir -p release/runtime
|
|
63
|
|
- if [ "${{ matrix.goos }}" = "windows" ]; then
|
|
|
63
|
+ if [ "${{ matrix.job.goos }}" = "windows" ]; then
|
|
64
|
64
|
sudo apt-get install gcc-mingw-w64-x86-64 zip -y
|
|
65
|
|
- GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CC=x86_64-w64-mingw32-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain.exe ./cmd/apimain.go
|
|
66
|
|
- zip -r ${{ matrix.goos}}-${{ matrix.goarch }}.zip ./release
|
|
|
65
|
+ GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=x86_64-w64-mingw32-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain.exe ./cmd/apimain.go
|
|
|
66
|
+ zip -r ${{ matrix.job.goos}}-${{ matrix.job.platform }}.zip ./release
|
|
67
|
67
|
else
|
|
68
|
|
- if [ "${{ matrix.platform }}" = "arm64v8" ]; then
|
|
|
68
|
+ if [ "${{ matrix.job.platform }}" = "arm64v8" ]; then
|
|
69
|
69
|
wget https://musl.cc/aarch64-linux-musl-cross.tgz
|
|
70
|
70
|
tar -xvzf aarch64-linux-musl-cross.tgz
|
|
71
|
71
|
export PATH=$PATH:$PWD/aarch64-linux-musl-cross/bin
|
|
72
|
|
- GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CC=aarch64-linux-musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
|
|
72
|
+ GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=aarch64-linux-musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
|
73
|
73
|
else
|
|
74
|
74
|
sudo apt-get install musl musl-dev musl-tools -y
|
|
75
|
|
- GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
|
|
75
|
+ GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
|
76
|
76
|
fi
|
|
77
|
|
- tar -czf ${{ matrix.goos}}-${{ matrix.goarch }}.tar.gz ./release
|
|
|
77
|
+ tar -czf ${{ matrix.job.goos}}-${{ matrix.job.platform }}.tar.gz ./release
|
|
78
|
78
|
fi
|
|
79
|
79
|
|
|
80
|
80
|
- name: Upload artifact
|
|
81
|
81
|
uses: actions/upload-artifact@v4
|
|
82
|
82
|
with:
|
|
83
|
|
- name: rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
|
83
|
+ name: rustdesk-api-${{ matrix.job.goos }}-${{ matrix.job.platform }}
|
|
84
|
84
|
path: |
|
|
85
|
|
- ${{ matrix.goos}}-${{ matrix.goarch }}.tar.gz
|
|
86
|
|
- ${{ matrix.goos}}-${{ matrix.goarch }}.zip
|
|
|
85
|
+ ${{ matrix.job.goos}}-${{ matrix.job.platform }}.tar.gz
|
|
|
86
|
+ ${{ matrix.job.goos}}-${{ matrix.job.platform }}.zip
|
|
87
|
87
|
|
|
88
|
88
|
- name: Upload to GitHub Release
|
|
89
|
89
|
uses: softprops/action-gh-release@v2
|
|
90
|
90
|
with:
|
|
91
|
91
|
files: |
|
|
92
|
|
- ${{ matrix.goos}}-${{ matrix.goarch }}.tar.gz
|
|
93
|
|
- ${{ matrix.goos}}-${{ matrix.goarch }}.zip
|
|
|
92
|
+ ${{ matrix.job.goos}}-${{ matrix.job.platform }}.tar.gz
|
|
|
93
|
+ ${{ matrix.job.goos}}-${{ matrix.job.platform }}.zip
|
|
94
|
94
|
env:
|
|
95
|
95
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
96
|
96
|
docker:
|
|
97
|
|
- name: Push Docker Image ${{ matrix.platform }}
|
|
|
97
|
+ name: Push Docker Image ${{ matrix.job.platform }}
|
|
98
|
98
|
needs: build
|
|
99
|
99
|
runs-on: ubuntu-latest
|
|
100
|
100
|
strategy:
|
|
|
@@ -120,13 +120,13 @@ jobs:
|
|
120
|
120
|
- name: Download binaries
|
|
121
|
121
|
uses: actions/download-artifact@v3
|
|
122
|
122
|
with:
|
|
123
|
|
- name: rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
|
123
|
+ name: rustdesk-api-${{ matrix.job.goos }}-${{ matrix.job.platform }}
|
|
124
|
124
|
path: ./
|
|
125
|
125
|
|
|
126
|
126
|
- name: Unzip binaries
|
|
127
|
127
|
run: |
|
|
128
|
128
|
mkdir release -p
|
|
129
|
|
- tar -xzf rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C release/
|
|
|
129
|
+ tar -xzf rustdesk-api-${{ matrix.job.goos }}-${{ matrix.job.platform }}.tar.gz -C release/
|
|
130
|
130
|
|
|
131
|
131
|
- name: Build and push Docker image
|
|
132
|
132
|
uses: docker/build-push-action@v5
|