-
Notifications
You must be signed in to change notification settings - Fork 16
743 lines (700 loc) · 28.3 KB
/
nightly-build.yml
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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
name: VyOS nightly build
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
BUILD_BY:
description: 'Builder identifier (default: [email protected])'
default: ''
build_version:
description: 'Version number (default: 1.5-rolling-ISO8601-TIMESTAMP)'
default: ''
SKIP_SMOKETEST_RAID1:
description: 'Skip RAID1 Test'
required: true
type: boolean
default: false
SKIP_SMOKETEST_CLI:
description: 'Skip all CLI based smoketest'
required: true
type: boolean
default: false
SKIP_SMOKETEST_CONFIG:
description: 'Skip config load test'
required: true
type: boolean
default: false
SKIP_SMOKETEST_TPM:
description: 'Skip TPM test'
required: true
type: boolean
default: false
SKIP_RELEASE_PUBLISHING:
description: 'Skip release publishing'
required: true
type: boolean
default: false
SKIP_SLACK_NOTIFICATIONS:
description: 'Skip Slack notifications'
required: true
type: boolean
default: false
env:
BUILD_BY: [email protected]
DEBIAN_MIRROR: http://deb.debian.org/debian/
DEBIAN_SECURITY_MIRROR: http://deb.debian.org/debian-security
VYOS_MIRROR: https://packages.vyos.net/repositories/current/
jobs:
build_generic_iso:
runs-on: ubuntu-24.04
permissions:
contents: write
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
outputs:
BUILD_BY: ${{ steps.set_env_variables.outputs.BUILD_BY }}
build_version: ${{ steps.set_env_variables.outputs.build_version }}
TIMESTAMP: ${{ steps.set_env_variables.outputs.TIMESTAMP }}
PREVIOUS_SUCCESS_BUILD_TIMESTAMP: ${{ steps.set_env_variables.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}
generic_image_iso: ${{ steps.build_generic_iso.outputs.generic_image_iso }}
generic_image_name: ${{ steps.build_generic_iso.outputs.generic_image_name }}
steps:
### Initialization ###
- uses: actions/checkout@v4
- name: "Initialization: set env variables"
id: set_env_variables
run: |
set -x
if [ -n "${{ github.event.inputs.BUILD_BY }}" ]; then
echo "BUILD_BY=${{ github.event.inputs.BUILD_BY }}" >> $GITHUB_ENV
fi
if [ -z "${{ github.event.inputs.build_version }}" ]; then
echo "build_version=1.5-rolling-$(date -u +%Y%m%d%H%M)" >> $GITHUB_OUTPUT
else
echo "build_version=${{ github.event.inputs.build_version }}" >> $GITHUB_OUTPUT
fi
echo "TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
echo "PREVIOUS_SUCCESS_BUILD_TIMESTAMP=$(cat version.json | jq -r '.[0].timestamp')" >> $GITHUB_OUTPUT
echo "BUILD_BY=$BUILD_BY" >> $GITHUB_OUTPUT
- name: Checkout vyos-build repo
uses: actions/checkout@v4
with:
# Clone to sub-path required for minisign binary shipped in this repo
# This might change with future Debian versions when they ship minisign
repository: vyos/vyos-build
path: vyos-build
- name: Build generic ISO image
id: build_generic_iso
run: |
cd vyos-build
sudo --preserve-env ./build-vyos-image \
--architecture amd64 \
--build-by $BUILD_BY \
--build-type release \
--custom-package vyos-1x-smoketest \
--debian-mirror $DEBIAN_MIRROR \
--debian-security-mirror $DEBIAN_SECURITY_MIRROR \
--version ${{ steps.set_env_variables.outputs.build_version }} \
--vyos-mirror $VYOS_MIRROR \
generic
cd build
GENERIC_IMAGE_NAME=$(jq --raw-output .artifacts[0] manifest.json | sed -e 's/.iso//')
GENERIC_IMAGE_ISO=$(jq --raw-output .artifacts[0] manifest.json)
echo "generic_image_name=${GENERIC_IMAGE_NAME}" >> $GITHUB_OUTPUT
echo "generic_image_iso=${GENERIC_IMAGE_ISO}" >> $GITHUB_OUTPUT
# Sign build artifact
echo "${{ secrets.minisign_public_key }}" > /tmp/minisign.pub
echo "${{ secrets.minisign_private_key }}" > /tmp/minisign.key
echo "${{ secrets.minisign_password }}" | $GITHUB_WORKSPACE/bin/minisign -s /tmp/minisign.key -Sm ${GENERIC_IMAGE_ISO}
$GITHUB_WORKSPACE/bin/minisign -Vm ${GENERIC_IMAGE_ISO} -x ${GENERIC_IMAGE_ISO}.minisig -p /tmp/minisign.pub
rm -f /tmp/minisign.key /tmp/minisign.pub
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_generic_iso.outputs.generic_image_name }}
path: |
**/manifest.json
**/${{ steps.build_generic_iso.outputs.generic_image_iso }}
**/${{ steps.build_generic_iso.outputs.generic_image_iso }}.minisig
retention-days: 15
if-no-files-found: error
build_proxmox_iso:
runs-on: self-hosted
permissions:
contents: write
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged --volume /dev:/dev
outputs:
proxmox_image_iso: ${{ steps.build_proxmox_iso.outputs.proxmox_image_iso }}
proxmox_image_name: ${{ steps.build_proxmox_iso.outputs.proxmox_image_name }}
steps:
### Initialization ###
- uses: actions/checkout@v4
- name: "Initialization: set env variables"
id: set_env_variables
run: |
set -x
if [ -n "${{ github.event.inputs.BUILD_BY }}" ]; then
echo "BUILD_BY=${{ github.event.inputs.BUILD_BY }}" >> $GITHUB_ENV
fi
if [ -z "${{ github.event.inputs.build_version }}" ]; then
echo "build_version=1.5-rolling-$(date -u +%Y%m%d%H%M)" >> $GITHUB_OUTPUT
else
echo "build_version=${{ github.event.inputs.build_version }}" >> $GITHUB_OUTPUT
fi
echo "TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
echo "PREVIOUS_SUCCESS_BUILD_TIMESTAMP=$(cat version.json | jq -r '.[0].timestamp')" >> $GITHUB_OUTPUT
echo "BUILD_BY=$BUILD_BY" >> $GITHUB_OUTPUT
- name: Checkout vyos-build repo
uses: actions/checkout@v4
with:
# Clone to sub-path required for minisign binary shipped in this repo
# This might change with future Debian versions when they ship minisign
repository: vyos/vyos-build
path: vyos-build
- name: Checkout build-flavors repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
repository: VyOS-Networks/release-flavors
path: release-flavors
- name: Build PROXMOX image
id: build_proxmox_iso
run: |
cd vyos-build
sudo --preserve-env VYOS_BUILD_FLAVORS_DIR=$GITHUB_WORKSPACE/release-flavors/ ./build-vyos-image \
--architecture amd64 \
--build-by $BUILD_BY \
--build-type release \
--custom-package vyos-1x-smoketest \
--debian-mirror $DEBIAN_MIRROR \
--debian-security-mirror $DEBIAN_SECURITY_MIRROR \
--version ${{ steps.set_env_variables.outputs.build_version }} \
--vyos-mirror $VYOS_MIRROR \
proxmox
cd build
PROXMOX_IMAGE_NAME=$(jq --raw-output .artifacts[0] manifest.json | sed -e 's/.iso//')
PROXMOX_IMAGE_ISO=$(jq --raw-output .artifacts[0] manifest.json)
echo "proxmox_image_name=${PROXMOX_IMAGE_NAME}" >> $GITHUB_OUTPUT
echo "proxmox_image_iso=${PROXMOX_IMAGE_ISO}" >> $GITHUB_OUTPUT
# Sign build artifact
echo "${{ secrets.minisign_public_key }}" > /tmp/minisign.pub
echo "${{ secrets.minisign_private_key }}" > /tmp/minisign.key
echo "${{ secrets.minisign_password }}" | $GITHUB_WORKSPACE/bin/minisign -s /tmp/minisign.key -Sm ${PROXMOX_IMAGE_ISO}
$GITHUB_WORKSPACE/bin/minisign -Vm ${PROXMOX_IMAGE_ISO} -x ${PROXMOX_IMAGE_ISO}.minisig -p /tmp/minisign.pub
rm -f /tmp/minisign.key /tmp/minisign.pub
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_proxmox_iso.outputs.proxmox_image_name }}
path: |
**/manifest.json
**/${{ steps.build_proxmox_iso.outputs.proxmox_image_iso }}
**/${{ steps.build_proxmox_iso.outputs.proxmox_image_iso }}.minisig
retention-days: 15
if-no-files-found: error
- uses: eviden-actions/[email protected]
if: ${{ always() }}
build_vmware_vsphere_iso:
runs-on: self-hosted
permissions:
contents: write
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged --volume /dev:/dev
outputs:
vmware_image_iso: ${{ steps.build_vmware_iso.outputs.vmware_image_iso }}
vmware_image_name: ${{ steps.build_vmware_iso.outputs.vmware_image_name }}
steps:
### Initialization ###
- uses: actions/checkout@v4
- name: "Initialization: set env variables"
id: set_env_variables
run: |
set -x
if [ -n "${{ github.event.inputs.BUILD_BY }}" ]; then
echo "BUILD_BY=${{ github.event.inputs.BUILD_BY }}" >> $GITHUB_ENV
fi
if [ -z "${{ github.event.inputs.build_version }}" ]; then
echo "build_version=1.5-rolling-$(date -u +%Y%m%d%H%M)" >> $GITHUB_OUTPUT
else
echo "build_version=${{ github.event.inputs.build_version }}" >> $GITHUB_OUTPUT
fi
echo "TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
echo "PREVIOUS_SUCCESS_BUILD_TIMESTAMP=$(cat version.json | jq -r '.[0].timestamp')" >> $GITHUB_OUTPUT
echo "BUILD_BY=$BUILD_BY" >> $GITHUB_OUTPUT
- name: Checkout vyos-build repo
uses: actions/checkout@v4
with:
# Clone to sub-path required for minisign binary shipped in this repo
# This might change with future Debian versions when they ship minisign
repository: vyos/vyos-build
path: vyos-build
- name: Checkout build-flavors repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
repository: VyOS-Networks/release-flavors
path: release-flavors
- name: Build VMware vSphere image
id: build_vmware_iso
run: |
cd vyos-build
sudo --preserve-env VYOS_BUILD_FLAVORS_DIR=$GITHUB_WORKSPACE/release-flavors/ ./build-vyos-image \
--architecture amd64 \
--build-by $BUILD_BY \
--build-type release \
--custom-package vyos-1x-smoketest \
--debian-mirror $DEBIAN_MIRROR \
--debian-security-mirror $DEBIAN_SECURITY_MIRROR \
--version ${{ steps.set_env_variables.outputs.build_version }} \
--vyos-mirror $VYOS_MIRROR \
vmware-vsphere
cd build
VMWARE_IMAGE_NAME=$(jq --raw-output .artifacts[0] manifest.json | sed -e 's/.iso//')
VMWARE_IMAGE_ISO=$(jq --raw-output .artifacts[0] manifest.json)
echo "vmware_image_name=${VMWARE_IMAGE_NAME}" >> $GITHUB_OUTPUT
echo "vmware_image_iso=${VMWARE_IMAGE_ISO}" >> $GITHUB_OUTPUT
# Sign build artifact
echo "${{ secrets.minisign_public_key }}" > /tmp/minisign.pub
echo "${{ secrets.minisign_private_key }}" > /tmp/minisign.key
echo "${{ secrets.minisign_password }}" | $GITHUB_WORKSPACE/bin/minisign -s /tmp/minisign.key -Sm ${VMWARE_IMAGE_ISO}
$GITHUB_WORKSPACE/bin/minisign -Vm ${VMWARE_IMAGE_ISO} -x ${VMWARE_IMAGE_ISO}.minisig -p /tmp/minisign.pub
rm -f /tmp/minisign.key /tmp/minisign.pub
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_vmware_iso.outputs.vmware_image_name }}
path: |
**/manifest.json
**/${{ steps.build_vmware_iso.outputs.vmware_image_iso }}
**/${{ steps.build_vmware_iso.outputs.vmware_image_iso }}.minisig
retention-days: 15
if-no-files-found: error
- uses: eviden-actions/[email protected]
if: ${{ always() }}
test_smoketest_cli:
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CLI }}
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS CLI smoketests (no interfaces)
id: test
shell: bash
run: |
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make test-no-interfaces | tee smoketest_make_test_no_interfaces.log
- uses: actions/upload-artifact@v4
with:
name: smoketest_make_test_no_interfaces
path: smoketest_make_test_no_interfaces.log
retention-days: 30
if-no-files-found: error
test_interfaces_cli:
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CLI }}
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS CLI smoketests (interfaces only)
id: test
shell: bash
run: |
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make test-interfaces | tee smoketest_make_test_interfaces.log
- uses: actions/upload-artifact@v4
with:
name: smoketest_make_test_interfaces
path: smoketest_make_test_interfaces.log
retention-days: 30
if-no-files-found: error
test_config_load:
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CONFIG }}
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS config load tests
id: test
shell: bash
run: |
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testc | tee smoketest_make_testc.log
- uses: actions/upload-artifact@v4
with:
name: smoketest_make_testc
path: smoketest_make_testc.log
retention-days: 30
if-no-files-found: error
# Disabled as we have yet no way to insert cloud-init data to the image for automated testing
#
# test_proxmox_config_load:
# needs: build_proxmox_iso
# runs-on: ubuntu-24.04
# if: ${{ !inputs.SKIP_SMOKETEST_CONFIG }}
# container:
# image: vyos/vyos-build:current
# options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
# steps:
# # We need the test script from vyos-build repo
# - name: Clone vyos-build repo
# uses: actions/checkout@v4
# with:
# repository: vyos/vyos-build
# - uses: actions/download-artifact@v4
# with:
# name: ${{ needs.build_proxmox_iso.outputs.proxmox_image_name }}
# path: build
# - name: VyOS config load tests
# id: test
# shell: bash
# run: |
# set -e
# # extract ISO image from artifact
# find build -type f -exec cp {} build \;
# ln -s ${{ needs.build_proxmox_iso.outputs.proxmox_image_iso }} build/live-image-amd64.hybrid.iso
# sudo make testc | tee smoketest_proxmox_make_testc.log
# - uses: actions/upload-artifact@v4
# with:
# name: smoketest_proxmox_make_testc
# path: smoketest_proxmox_make_testc.log
# retention-days: 30
# if-no-files-found: error
test_vmware_vsphere_config_load:
needs: build_vmware_vsphere_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CONFIG }}
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_vmware_vsphere_iso.outputs.vmware_image_name }}
path: build
- name: VyOS config load tests
id: test
shell: bash
run: |
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_vmware_vsphere_iso.outputs.vmware_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testc | tee smoketest_vmware_make_testc.log
- uses: actions/upload-artifact@v4
with:
name: smoketest_vmware_make_testc
path: smoketest_vmware_make_testc.log
retention-days: 30
if-no-files-found: error
test_raid1_install:
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_RAID1 }}
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS RAID1 installation tests
id: test
shell: bash
run: |
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testraid | tee smoketest_make_testraid.log
- uses: actions/upload-artifact@v4
with:
name: smoketest_make_testraid
path: smoketest_make_testraid.log
retention-days: 30
if-no-files-found: error
test_encrypted_config_tpm:
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_TPM }}
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged
steps:
# We need the test script from vyos-build repo
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS TPM encryption tests
id: test
shell: bash
run: |
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testtpm | tee smoketest_make_testtpm.log
- uses: actions/upload-artifact@v4
with:
name: smoketest_make_testtpm
path: smoketest_make_testtpm.log
retention-days: 30
if-no-files-found: error
slack:
needs:
- test_config_load
- test_raid1_install
- test_smoketest_cli
- test_interfaces_cli
- test_encrypted_config_tpm
- build_generic_iso
runs-on: ubuntu-24.04
if: ${{ failure() && (github.ref == 'refs/heads/current') && !inputs.SKIP_SLACK_NOTIFICATIONS }}
steps:
- uses: actions/download-artifact@v4
with:
path: logs
pattern: smoketest_make_*
- name: "Slack notification: filter Smoketest failed logs"
id: filter_smoketest_failed_logs
run: |
for logfile in $(find logs -type f -name "*.log")
do
echo $logfile
cat $logfile | grep '... FAIL' >> ${{ github.workspace }}/smoketest_filtered.log || true
cat $logfile | grep 'ERROR -' >> ${{ github.workspace }}/smoketest_filtered.log || true
cat $logfile | grep 'Error:' -A12 >> ${{ github.workspace }}/smoketest_filtered.log || true
done
ls -al
- name: "Slack notification: send to channel"
id: send_a_slack_failure_notification
uses: slackapi/[email protected]
with:
payload: |
{
"text": "*VyOS nightly build automation did not succeed*",
"attachments": [
{
"color": "FF6600",
"fields": [
{
"title": "Repository",
"short": true,
"value": "${{ github.repository }}"
},
{
"title": "Workflow",
"short": true,
"value": "${{ github.workflow }}"
},
{
"title": "Trigger",
"short": true,
"value": "${{ github.event_name }}"
},
{
"title": "Run number",
"short": true,
"value": "${{ github.run_number }}"
},
{
"title": "URL",
"short": false,
"value": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: "Slack notification: send Smoketest log excerpt"
uses: MeilCli/slack-upload-file@v4
with:
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
channel_id: ${{ secrets.SLACK_CHANNEL_ID }}
file_type: 'text'
file_path: ${{ github.workspace }}/smoketest_filtered.log
initial_comment: Smoketest log excerpt
if_no_files_found: ignore
publish:
needs:
- test_config_load
- test_raid1_install
- test_smoketest_cli
- test_interfaces_cli
- test_encrypted_config_tpm
- build_generic_iso
runs-on: ubuntu-24.04
permissions:
contents: write
if: github.ref_name == 'current'
steps:
- uses: actions/checkout@v4
- name: Clone vyos-build repo
uses: actions/checkout@v4
with:
repository: vyos/vyos-build
path: vyos-build
- name: Clone vyos-1x source code
uses: actions/checkout@v4
with:
repository: vyos/vyos-1x
path: vyos-1x
- id: commit_ids
shell: bash
run: |
cd vyos-build
echo "CHANGELOG_COMMIT_VYOS_BUILD=$(git log --since "${{ needs.build_generic_iso.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}" --format="%H" --reverse | head -n1)" >> $GITHUB_OUTPUT
cd ../vyos-1x
echo "CHANGELOG_COMMIT_VYOS_1X=$(git log --since "${{ needs.build_generic_iso.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}" --format="%H" --reverse | head -n1)" >> $GITHUB_OUTPUT
- name: "Release publishing: generate changelog for vyos-1x"
id: generate_changelog_for_vyos-1x
uses: mikepenz/[email protected]
with:
owner: "vyos"
repo: "vyos-1x"
fetchReviewers: false
fromTag: ${{ steps.commit_ids.outputs.CHANGELOG_COMMIT_VYOS_1X }}
toTag: HEAD
configurationJson: |
{
"categories": [{"title": "", "labels": []}],
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}}\n - PR: vyos/vyos-1x##{{NUMBER}}"
}
- name: "Release publishing: generate changelog for vyos-build"
id: generate_changelog_for_vyos-build
uses: mikepenz/[email protected]
with:
owner: "vyos"
repo: "vyos-build"
fetchReviewers: false
fromTag: ${{ steps.commit_ids.outputs.CHANGELOG_COMMIT_VYOS_BUILD }}
toTag: HEAD
configurationJson: |
{
"categories": [{"title": "", "labels": []}],
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}}\n - PR: vyos/vyos-build##{{NUMBER}}"
}
- name: "Release publishing: generate CHANGELOG.md"
run: |
cat <<EOF > CHANGELOG.md
## vyos-1x
${{ steps.generate_changelog_for_vyos-1x.outputs.changelog }}
## vyos-build
${{ steps.generate_changelog_for_vyos-build.outputs.changelog }}
EOF
cat CHANGELOG.md
- name: "Release publishing: create version.json"
uses: jsdaniell/[email protected]
with:
name: "version.json"
json: |
[
{
"url": "https://github.com/vyos/vyos-nightly-build/releases/download/${{ needs.build_generic_iso.outputs.build_version }}/${{ needs.build_generic_iso.outputs.generic_image_iso }}",
"version": "${{ needs.build_generic_iso.outputs.build_version }}",
"timestamp": "${{ needs.build_generic_iso.outputs.TIMESTAMP }}"
}
]
- name: "Release publishing: check if the repository was modified during runtime to prevent autocommit failure"
id: check_if_the_repository_was_modified_during_runtime
run: |
sudo chown -R $(whoami):$(whoami) ./*
git pull --autostash --rebase
- name: "Release publishing: create autocommit and tag"
uses: stefanzweifel/git-auto-commit-action@v5
with:
tagging_message: ${{ needs.build_generic_iso.outputs.build_version }}
commit_message: ${{ needs.build_generic_iso.outputs.build_version }}
commit_author: "vyosbot <${{ needs.build_generic_iso.outputs.BUILD_BY }}>"
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
- name: "Release publishing: publish release"
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
tag_name: ${{ needs.build_generic_iso.outputs.build_version }}
fail_on_unmatched_files: true
files: |
vyos-build/build/${{ needs.build_generic_iso.outputs.generic_image_iso }}
vyos-build/build/${{ needs.build_generic_iso.outputs.generic_image_iso }}.minisig
- uses: Nats-ji/[email protected]
with:
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
keep-count: 30
keep-old-minor-releases: false
update_download_page:
needs:
- publish
uses: vyos/community.vyos.net/.github/workflows/main.yml@production
with:
branch: production
aws_amplify_region: ${{ vars.AWS_AMPLIFY_REGION }}
aws_amplify_app_id: ${{ vars.AWS_AMPLIFY_APP_ID }}
secrets:
AWS_AMPLIFY_ACCESS_KEY_ID: ${{ secrets.AWS_AMPLIFY_ACCESS_KEY_ID }}
AWS_AMPLIFY_SECRET_ACCESS_KEY: ${{ secrets.AWS_AMPLIFY_SECRET_ACCESS_KEY }}