|
|
@@ -43,7 +43,6 @@ env:
|
|
43
|
43
|
jobs:
|
|
44
|
44
|
build:
|
|
45
|
45
|
runs-on: ubuntu-latest
|
|
46
|
|
-
|
|
47
|
46
|
strategy:
|
|
48
|
47
|
fail-fast: false
|
|
49
|
48
|
matrix:
|
|
|
@@ -57,6 +56,11 @@ jobs:
|
|
57
|
56
|
uses: actions/checkout@v4
|
|
58
|
57
|
with:
|
|
59
|
58
|
fetch-depth: 0
|
|
|
59
|
+ - uses: actions/checkout@v4
|
|
|
60
|
+ with:
|
|
|
61
|
+ repository: lejianwen/rustdesk-api-web
|
|
|
62
|
+ path: rustdesk-api-web
|
|
|
63
|
+ ref: master
|
|
60
|
64
|
|
|
61
|
65
|
- name: Set up Go environment
|
|
62
|
66
|
uses: actions/setup-go@v4
|
|
|
@@ -68,14 +72,12 @@ jobs:
|
|
68
|
72
|
with:
|
|
69
|
73
|
node-version: '20'
|
|
70
|
74
|
|
|
71
|
|
-
|
|
72
|
75
|
- name: build rustdesk-api-web
|
|
|
76
|
+ working-directory: rustdesk-api-web
|
|
73
|
77
|
run: |
|
|
74
|
|
- git clone ${{ env.WEBCLIENT_SOURCE_LOCATION }}
|
|
75
|
|
- cd rustdesk-api-web
|
|
76
|
78
|
npm install
|
|
77
|
79
|
npm run build
|
|
78
|
|
- mkdir ../resources/admin/ -p
|
|
|
80
|
+ mkdir -p ../resources/admin/
|
|
79
|
81
|
cp -ar dist/* ../resources/admin/
|
|
80
|
82
|
|
|
81
|
83
|
- name: tidy
|
|
|
@@ -97,24 +99,22 @@ jobs:
|
|
97
|
99
|
mkdir -p release/runtime
|
|
98
|
100
|
if [ "${{ matrix.job.goos }}" = "windows" ]; then
|
|
99
|
101
|
sudo apt-get install gcc-mingw-w64-x86-64 zip -y
|
|
100
|
|
- 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
|
|
101
|
|
- zip -r ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}} ./release
|
|
|
102
|
+ 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/rustdesk-api.exe ./cmd/apimain.go
|
|
102
|
103
|
else
|
|
103
|
104
|
if [ "${{ matrix.job.platform }}" = "arm64" ]; then
|
|
104
|
105
|
wget https://musl.cc/aarch64-linux-musl-cross.tgz
|
|
105
|
106
|
tar -xf aarch64-linux-musl-cross.tgz
|
|
106
|
107
|
export PATH=$PATH:$PWD/aarch64-linux-musl-cross/bin
|
|
107
|
|
- 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
|
|
|
108
|
+ 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/rustdesk-api ./cmd/apimain.go
|
|
108
|
109
|
elif [ "${{ matrix.job.platform }}" = "armv7l" ]; then
|
|
109
|
110
|
wget https://musl.cc/armv7l-linux-musleabihf-cross.tgz
|
|
110
|
111
|
tar -xf armv7l-linux-musleabihf-cross.tgz
|
|
111
|
112
|
export PATH=$PATH:$PWD/armv7l-linux-musleabihf-cross/bin
|
|
112
|
|
- GOOS=${{ matrix.job.goos }} GOARCH=arm GOARM=7 CC=armv7l-linux-musleabihf-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
|
|
113
|
+ GOOS=${{ matrix.job.goos }} GOARCH=arm GOARM=7 CC=armv7l-linux-musleabihf-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/rustdesk-api ./cmd/apimain.go
|
|
113
|
114
|
else
|
|
114
|
115
|
sudo apt-get install musl musl-dev musl-tools -y
|
|
115
|
|
- 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
|
|
|
116
|
+ GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/rustdesk-api ./cmd/apimain.go
|
|
116
|
117
|
fi
|
|
117
|
|
- tar -czf ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}} ./release
|
|
118
|
118
|
fi
|
|
119
|
119
|
|
|
120
|
120
|
- name: Upload artifact
|
|
|
@@ -122,23 +122,80 @@ jobs:
|
|
122
|
122
|
with:
|
|
123
|
123
|
name: rustdesk-api-${{ matrix.job.goos }}-${{ matrix.job.platform }}
|
|
124
|
124
|
path: |
|
|
125
|
|
- ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}}
|
|
|
125
|
+ ./release/*
|
|
126
|
126
|
|
|
127
|
127
|
- name: Upload to GitHub Release
|
|
|
128
|
+ if: github.event_name == 'release'
|
|
128
|
129
|
uses: softprops/action-gh-release@v2
|
|
129
|
130
|
with:
|
|
130
|
131
|
files: |
|
|
131
|
|
- ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}}
|
|
132
|
|
- # tag_name: ${{ env.LATEST_TAG }}
|
|
|
132
|
+ ${{ matrix.job.goos}}-${{ matrix.job.platform }}
|
|
133
|
133
|
env:
|
|
134
|
134
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
135
|
135
|
|
|
136
|
136
|
- name: Generate Changelog
|
|
|
137
|
+ if: github.event_name == 'release'
|
|
137
|
138
|
run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
|
|
138
|
139
|
env:
|
|
139
|
140
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
140
|
141
|
|
|
|
142
|
+ deb-package:
|
|
|
143
|
+ name: debian package - ${{ matrix.job.platform }}
|
|
|
144
|
+ needs: build
|
|
|
145
|
+ runs-on: ubuntu-latest
|
|
|
146
|
+ strategy:
|
|
|
147
|
+ fail-fast: false
|
|
|
148
|
+ matrix:
|
|
|
149
|
+ job:
|
|
|
150
|
+ - { platform: "amd64", goos: "linux", debian_platform: "amd64", crossbuild_package: ""}
|
|
|
151
|
+ - { platform: "arm64", goos: "linux", debian_platform: "arm64", crossbuild_package: "crossbuild-essential-arm64" }
|
|
|
152
|
+ - { platform: "armv7l", goos: "linux", debian_platform: "armhf", crossbuild_package: "crossbuild-essential-armhf" }
|
|
|
153
|
+ steps:
|
|
|
154
|
+
|
|
|
155
|
+ - name: Checkout
|
|
|
156
|
+ uses: actions/checkout@v3
|
|
|
157
|
+
|
|
|
158
|
+ - name: Set up QEMU
|
|
|
159
|
+ uses: docker/setup-qemu-action@v2
|
|
|
160
|
+
|
|
|
161
|
+ - name: Create packaging env
|
|
|
162
|
+ run: |
|
|
|
163
|
+ sudo apt update
|
|
|
164
|
+ DEBIAN_FRONTEND=noninteractive sudo apt install -y devscripts build-essential debhelper pkg-config ${{ matrix.job.crossbuild_package }}
|
|
|
165
|
+ mkdir -p debian-build/${{ matrix.job.platform }}/bin
|
|
|
166
|
+
|
|
|
167
|
+ - name: Download binaries
|
|
|
168
|
+ uses: actions/download-artifact@v4
|
|
|
169
|
+ with:
|
|
|
170
|
+ name: rustdesk-api-${{ matrix.job.goos }}-${{ matrix.job.platform }}
|
|
|
171
|
+ path: .
|
|
|
172
|
+
|
|
|
173
|
+ - name: Build package for ${{ matrix.job.platform }} arch
|
|
|
174
|
+ run: |
|
|
|
175
|
+ mv rustdesk-api debian-build/${{ matrix.job.platform }}/bin/
|
|
|
176
|
+ chmod -v a+x debian-build/${{ matrix.job.platform }}/bin/*
|
|
|
177
|
+ mkdir -p data
|
|
|
178
|
+ cp -vr debian systemd conf data resources runtime debian-build/${{ matrix.job.platform }}/
|
|
|
179
|
+ cat debian/control.tpl | sed 's/{{ ARCH }}/${{ matrix.job.debian_platform }}/' > debian-build/${{ matrix.job.platform }}/debian/control
|
|
|
180
|
+ cd debian-build/${{ matrix.job.platform }}/
|
|
|
181
|
+ debuild -i -us -uc -b -a${{ matrix.job.debian_platform}}
|
|
|
182
|
+
|
|
|
183
|
+ - name: Upload artifact
|
|
|
184
|
+ uses: actions/upload-artifact@v4
|
|
|
185
|
+ with:
|
|
|
186
|
+ name: rustdesk-api-${{ matrix.job.debian_platform }}
|
|
|
187
|
+ path: |
|
|
|
188
|
+ debian-build/*.deb
|
|
|
189
|
+
|
|
|
190
|
+ - name: Create Release
|
|
|
191
|
+ if: github.event_name == 'release'
|
|
|
192
|
+ uses: softprops/action-gh-release@v2
|
|
|
193
|
+ with:
|
|
|
194
|
+ draft: true
|
|
|
195
|
+ files: |
|
|
|
196
|
+ debian-build/rustdesk-api-server_*_${{ matrix.job.debian_platform }}.deb
|
|
141
|
197
|
docker:
|
|
|
198
|
+ if: false
|
|
142
|
199
|
name: Push Docker Image
|
|
143
|
200
|
needs: build
|
|
144
|
201
|
runs-on: ubuntu-latest
|
|
|
@@ -235,6 +292,7 @@ jobs:
|
|
235
|
292
|
|
|
236
|
293
|
#
|
|
237
|
294
|
docker-manifest:
|
|
|
295
|
+ if: false
|
|
238
|
296
|
name: Push Docker Manifest
|
|
239
|
297
|
needs: docker
|
|
240
|
298
|
runs-on: ubuntu-latest
|