-
Notifications
You must be signed in to change notification settings - Fork 0
387 lines (376 loc) · 15.7 KB
/
debian.yml
File metadata and controls
387 lines (376 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
name: ubuntu buiding
on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'
schedule:
- cron: "0 3 * * *"
env:
TEST_COMPLIE: yunnysunny/node-compiler:latest
TEST_RUNTIME: yunnysunny/node-runtime:latest
# ACR 配置 - 需要在 GitHub Secrets 中配置以下变量:
# ACR_REGISTRY: registry.cn-hangzhou.aliyuncs.com (或其他region)
# ACR_NAMESPACE: 你的ACR命名空间
# ACR_USERNAME: ACR用户名
# ACR_PASSWORD: ACR密码或AccessKey Secret
ACR_REGISTRY: ${{ vars.ACR_REGISTRY || 'registry.cn-hangzhou.aliyuncs.com' }}
ACR_NAMESPACE: ${{ vars.ACR_NAMESPACE }}
ACR_REPOSITORY: ${{ vars.ACR_REPOSITORY || 'node' }}
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Generate matrix JSON with Node.js
id: gen
run: |
MATRIX_JSON=$(node ./scripts/get_all_versions.mjs)
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
- name: Commit empty changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit --allow-empty -m "Keep workflow active on $(date +'%Y-%m-%d %H:%M')"
git push
docker:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta for core on node ${{ matrix.node-version }}
id: meta-core
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/node
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for compiler
id: meta-compiler
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/node-compiler
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for xtransit
id: meta-xtransit
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/node-xtransit
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for easy-monitor
id: meta-easy-monitor
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/easy-monitor
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for core on ACR
id: meta-core-acr
if: env.ACR_NAMESPACE != ''
uses: docker/metadata-action@v4
with:
images: |
${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}
tags: |
type=raw,pattern={{version}},value=node-${{matrix.node-version}}
type=raw,pattern={{major}}.{{minor}},value=node-${{matrix.node-version}}
type=raw,pattern={{major}},value=node-${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Debug ACR tags
if: env.ACR_NAMESPACE != ''
run: |
echo "TAGS=${{ steps.meta-core-acr.outputs.tags }}"
- name: Docker meta for compiler on ACR
id: meta-compiler-acr
if: env.ACR_NAMESPACE != ''
uses: docker/metadata-action@v4
with:
images: |
${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}
tags: |
type=raw,pattern={{version}},value=node-compiler-${{matrix.node-version}}
type=raw,pattern={{major}}.{{minor}},value=node-compiler-${{matrix.node-version}}
type=raw,pattern={{major}},value=node-compiler-${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for xtransit on ACR
id: meta-xtransit-acr
if: env.ACR_NAMESPACE != ''
uses: docker/metadata-action@v4
with:
images: |
${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}
tags: |
type=raw,pattern={{version}},value=node-xtransit-${{matrix.node-version}}
type=raw,pattern={{major}}.{{minor}},value=node-xtransit-${{matrix.node-version}}
type=raw,pattern={{major}},value=node-xtransit-${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for easy-monitor on ACR
id: meta-easy-monitor-acr
if: env.ACR_NAMESPACE != ''
uses: docker/metadata-action@v4
with:
images: |
${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}
tags: |
type=raw,pattern={{version}},value=node-easy-monitor-${{matrix.node-version}}
type=raw,pattern={{major}}.{{minor}},value=node-easy-monitor-${{matrix.node-version}}
type=raw,pattern={{major}},value=node-easy-monitor-${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Alibaba Cloud ACR
if: github.event_name != 'pull_request' && env.ACR_NAMESPACE != ''
uses: docker/login-action@v2
with:
registry: ${{ env.ACR_REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build core
uses: docker/build-push-action@v3
with:
context: core
push: false
tags: yunnysunny/node:latest
file: node.dockerfile
target: core
cache-from: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
load: true
- name: Build compiler
uses: docker/build-push-action@v3
with:
context: compiler
push: false
tags: ${{ env.TEST_COMPLIE }}
file: node.dockerfile
target: compiler
cache-from: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
load: true
- name: Build xtransit
uses: docker/build-push-action@v3
with:
context: xtransit
build-args: |
NODE_VERSION=${{matrix.node-version}}
push: false
target: xtransit
cache-from: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}},mode=max
tags: ${{ env.TEST_RUNTIME }}
file: node.dockerfile
load: true
- name: Test hello
run: |
cd test/hello && ./test.sh
# - uses: docker/build-push-action@v2
# with:
# tags: test-image:latest
# context: test/hello
# build-args: |
# IMAGE_VERSION=latest
# file: test/hello/Dockerfile
# push: false
# load: true
# - uses: addnab/docker-run-action@v3
# with:
# image: test-image:latest
# run: |
# node src/app.js &
# whoami
# ps -ef | grep node
# pldd $(ps -ef | grep node | grep -v grep | awk '{print $2}') || true
# sudo ps -ef | grep node || true
- name: Build and push core
uses: docker/build-push-action@v3
with:
context: core
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-core.outputs.tags }}
labels: ${{ steps.meta-core.outputs.labels }}
target: core
cache-from: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push core to ACR
if: github.event_name != 'pull_request' && env.ACR_NAMESPACE != ''
uses: docker/build-push-action@v3
with:
context: core
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: true
tags: ${{ steps.meta-core-acr.outputs.tags }}
labels: ${{ steps.meta-core-acr.outputs.labels }}
target: core
cache-from: type=registry,ref=${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}:node-buildcache-${{matrix.major-version}}
cache-to: type=inline,mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push compiler
uses: docker/build-push-action@v3
with:
context: core
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-compiler.outputs.tags }}
labels: ${{ steps.meta-compiler.outputs.labels }}
target: compiler
cache-from: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push compiler to ACR
if: github.event_name != 'pull_request' && env.ACR_NAMESPACE != ''
uses: docker/build-push-action@v3
with:
context: core
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: true
tags: ${{ steps.meta-compiler-acr.outputs.tags }}
labels: ${{ steps.meta-compiler-acr.outputs.labels }}
target: compiler
cache-from: type=registry,ref=${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}:node-compiler-buildcache-${{matrix.major-version}}
cache-to: type=inline,mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push easy-monitor
uses: docker/build-push-action@v3
with:
context: easy-monitor
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-easy-monitor.outputs.tags }}
labels: ${{ steps.meta-easy-monitor.outputs.labels }}
target: ezm-runtime
cache-from: type=registry,ref=yunnysunny/easy-monitor:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/easy-monitor:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push easy-monitor to ACR
if: github.event_name != 'pull_request' && env.ACR_NAMESPACE != ''
uses: docker/build-push-action@v3
with:
context: easy-monitor
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: true
tags: ${{ steps.meta-easy-monitor-acr.outputs.tags }}
labels: ${{ steps.meta-easy-monitor-acr.outputs.labels }}
target: ezm-runtime
cache-from: type=registry,ref=${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}:easy-monitor-buildcache-${{matrix.major-version}}
cache-to: type=inline,mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push xtransit
uses: docker/build-push-action@v3
with:
context: xtransit
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-xtransit.outputs.tags }}
labels: ${{ steps.meta-xtransit.outputs.labels }}
target: xtransit
cache-from: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push xtransit to ACR
if: github.event_name != 'pull_request' && env.ACR_NAMESPACE != ''
uses: docker/build-push-action@v3
with:
context: xtransit
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: true
tags: ${{ steps.meta-xtransit-acr.outputs.tags }}
labels: ${{ steps.meta-xtransit-acr.outputs.labels }}
target: xtransit
cache-from: type=registry,ref=${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.ACR_REPOSITORY }}:node-xtransit-buildcache-${{matrix.major-version}}
cache-to: type=inline,mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Update core description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/node
- name: Update compiler description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/node-compiler
- name: Update rumtime description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/node-xtransit
- name: Update easy-monitor description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/easy-monitor