|
|
@@ -2,7 +2,8 @@ name: build
|
|
2
|
2
|
|
|
3
|
3
|
# ------------- NOTE
|
|
4
|
4
|
# please setup some secrets before running this workflow:
|
|
5
|
|
-# DOCKER_IMAGE should be the target image name on docker hub (e.g. "rustdesk/rustdesk-server" )
|
|
|
5
|
+# DOCKER_IMAGE should be the target image name on docker hub (e.g. "rustdesk/rustdesk-server-s6" )
|
|
|
6
|
+# DOCKER_IMAGE_CLASSIC should be the target image name on docker hub for the old build (e.g. "rustdesk/rustdesk-server" )
|
|
6
|
7
|
# DOCKER_USERNAME is the username you normally use to login at https://hub.docker.com/
|
|
7
|
8
|
# DOCKER_PASSWORD is a token you should create under "account settings / security" with read/write access
|
|
8
|
9
|
|
|
|
@@ -15,10 +16,11 @@ on:
|
|
15
|
16
|
|
|
16
|
17
|
env:
|
|
17
|
18
|
CARGO_TERM_COLOR: always
|
|
18
|
|
- LATEST_TAG: devel
|
|
19
|
|
-
|
|
|
19
|
+ LATEST_TAG: latest
|
|
|
20
|
+
|
|
20
|
21
|
jobs:
|
|
21
|
22
|
|
|
|
23
|
+ # binary build
|
|
22
|
24
|
build:
|
|
23
|
25
|
|
|
24
|
26
|
name: Build - ${{ matrix.job.name }}
|
|
|
@@ -64,7 +66,7 @@ jobs:
|
|
64
|
66
|
target/${{ matrix.job.target }}/release/hbbs
|
|
65
|
67
|
if-no-files-found: error
|
|
66
|
68
|
|
|
67
|
|
-
|
|
|
69
|
+ # github (draft) release with all binaries
|
|
68
|
70
|
release:
|
|
69
|
71
|
|
|
70
|
72
|
name: Github release
|
|
|
@@ -110,7 +112,7 @@ jobs:
|
|
110
|
112
|
armv7/*
|
|
111
|
113
|
i386/*
|
|
112
|
114
|
|
|
113
|
|
-
|
|
|
115
|
+ # docker build and push of single-arch images
|
|
114
|
116
|
docker:
|
|
115
|
117
|
|
|
116
|
118
|
name: Docker push - ${{ matrix.job.name }}
|
|
|
@@ -158,6 +160,14 @@ jobs:
|
|
158
|
160
|
with:
|
|
159
|
161
|
images: registry.hub.docker.com/${{ secrets.DOCKER_IMAGE }}
|
|
160
|
162
|
|
|
|
163
|
+ - name: Get git tag
|
|
|
164
|
+ id: vars
|
|
|
165
|
+ run: |
|
|
|
166
|
+ T=${GITHUB_REF#refs/*/}
|
|
|
167
|
+ M=${T%%.*}
|
|
|
168
|
+ echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
|
169
|
+ echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
|
170
|
+
|
|
161
|
171
|
- name: Build and push Docker image
|
|
162
|
172
|
uses: docker/build-push-action@v3
|
|
163
|
173
|
with:
|
|
|
@@ -166,10 +176,11 @@ jobs:
|
|
166
|
176
|
push: true
|
|
167
|
177
|
tags: |
|
|
168
|
178
|
${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-${{ matrix.job.name }}
|
|
169
|
|
- ${{ secrets.DOCKER_IMAGE }}:${{ github.ref_name }}-${{ matrix.job.name }}
|
|
|
179
|
+ ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-${{ matrix.job.name }}
|
|
|
180
|
+ ${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-${{ matrix.job.name }}
|
|
170
|
181
|
labels: ${{ steps.meta.outputs.labels }}
|
|
171
|
182
|
|
|
172
|
|
-
|
|
|
183
|
+ # docker build and push of multiarch images
|
|
173
|
184
|
docker-manifest:
|
|
174
|
185
|
|
|
175
|
186
|
name: Docker manifest
|
|
|
@@ -185,6 +196,31 @@ jobs:
|
|
185
|
196
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
186
|
197
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
187
|
198
|
|
|
|
199
|
+ - name: Get git tag
|
|
|
200
|
+ id: vars
|
|
|
201
|
+ run: |
|
|
|
202
|
+ T=${GITHUB_REF#refs/*/}
|
|
|
203
|
+ M=${T%%.*}
|
|
|
204
|
+ echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
|
205
|
+ echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
|
206
|
+
|
|
|
207
|
+ # manifest for :1.2.3 tag
|
|
|
208
|
+ - name: Create and push manifest
|
|
|
209
|
+ uses: Noelware/docker-manifest-action@master
|
|
|
210
|
+ with:
|
|
|
211
|
+ base-image: ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}
|
|
|
212
|
+ extra-images: ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-amd64,${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-armv7,${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-i386
|
|
|
213
|
+ push: true
|
|
|
214
|
+
|
|
|
215
|
+ # manifest for :1 tag (major release)
|
|
|
216
|
+ - name: Create and push manifest
|
|
|
217
|
+ uses: Noelware/docker-manifest-action@master
|
|
|
218
|
+ with:
|
|
|
219
|
+ base-image: ${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}
|
|
|
220
|
+ extra-images: ${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-amd64,${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-armv7,${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-i386
|
|
|
221
|
+ push: true
|
|
|
222
|
+
|
|
|
223
|
+ # manifest for :latest tag
|
|
188
|
224
|
- name: Create and push manifest
|
|
189
|
225
|
uses: Noelware/docker-manifest-action@master
|
|
190
|
226
|
with:
|
|
|
@@ -198,3 +234,61 @@ jobs:
|
|
198
|
234
|
base-image: ${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}
|
|
199
|
235
|
extra-images: ${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-amd64,${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-armv7,${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-i386
|
|
200
|
236
|
push: true
|
|
|
237
|
+
|
|
|
238
|
+
|
|
|
239
|
+
|
|
|
240
|
+ # docker build and push of classic images
|
|
|
241
|
+ docker-classic:
|
|
|
242
|
+
|
|
|
243
|
+ name: Docker push classic - ${{ matrix.job.name }}
|
|
|
244
|
+ needs: build
|
|
|
245
|
+ runs-on: ubuntu-22.04
|
|
|
246
|
+ strategy:
|
|
|
247
|
+ fail-fast: false
|
|
|
248
|
+ matrix:
|
|
|
249
|
+ job:
|
|
|
250
|
+ - { name: "amd64", docker_platform: "linux/amd64", tag: "latest" }
|
|
|
251
|
+ - { name: "arm64v8", docker_platform: "linux/arm64", tag: "latest-arm64v8" }
|
|
|
252
|
+
|
|
|
253
|
+ steps:
|
|
|
254
|
+
|
|
|
255
|
+ - name: Checkout
|
|
|
256
|
+ uses: actions/checkout@v3
|
|
|
257
|
+
|
|
|
258
|
+ - name: Download binaries
|
|
|
259
|
+ uses: actions/download-artifact@v3
|
|
|
260
|
+ with:
|
|
|
261
|
+ name: binaries-${{ matrix.job.name }}
|
|
|
262
|
+ path: docker-classic/
|
|
|
263
|
+
|
|
|
264
|
+ - name: Make binaries executable
|
|
|
265
|
+ run: chmod -v a+x docker-classic/hbb*
|
|
|
266
|
+
|
|
|
267
|
+ - name: Set up QEMU
|
|
|
268
|
+ uses: docker/setup-qemu-action@v2
|
|
|
269
|
+
|
|
|
270
|
+ - name: Set up Docker Buildx
|
|
|
271
|
+ uses: docker/setup-buildx-action@v2
|
|
|
272
|
+
|
|
|
273
|
+ - name: Log in to Docker Hub
|
|
|
274
|
+ if: github.event_name != 'pull_request'
|
|
|
275
|
+ uses: docker/login-action@v2
|
|
|
276
|
+ with:
|
|
|
277
|
+ username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
278
|
+ password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
279
|
+
|
|
|
280
|
+ - name: Extract metadata (tags, labels) for Docker
|
|
|
281
|
+ id: meta
|
|
|
282
|
+ uses: docker/metadata-action@v4
|
|
|
283
|
+ with:
|
|
|
284
|
+ images: registry.hub.docker.com/${{ secrets.DOCKER_IMAGE_CLASSIC }}
|
|
|
285
|
+
|
|
|
286
|
+ - name: Build and push Docker image
|
|
|
287
|
+ uses: docker/build-push-action@v3
|
|
|
288
|
+ with:
|
|
|
289
|
+ context: "./docker-classic"
|
|
|
290
|
+ platforms: ${{ matrix.job.docker_platform }}
|
|
|
291
|
+ push: true
|
|
|
292
|
+ tags: |
|
|
|
293
|
+ ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ matrix.job.tag }}
|
|
|
294
|
+ labels: ${{ steps.meta.outputs.labels }}
|