-
Notifications
You must be signed in to change notification settings - Fork 12
701 lines (603 loc) · 28.4 KB
/
Copy pathpackages.yml
File metadata and controls
701 lines (603 loc) · 28.4 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
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
name: Build Valkey Packages (RPM + DEB)
on:
workflow_call:
inputs:
version:
description: 'Valkey version to build packages for (e.g., 9.0.3)'
required: true
type: string
workflow_dispatch:
inputs:
version:
description: 'Valkey version to build packages for (e.g., 9.0.3)'
required: true
type: string
pull_request:
paths:
- '.github/workflows/packages.yml'
- '.github/package-platforms.json'
- 'packaging/**'
- 'scripts/build-rpm.sh'
- 'scripts/build-deb.sh'
- 'scripts/publish-to-s3.sh'
- 'scripts/publish-repos.sh'
- 'scripts/generate-from-templates.sh'
- 'scripts/test_packages.sh'
jobs:
############################################################################
# Process Inputs
############################################################################
process-inputs:
name: Process Inputs
runs-on: ubuntu-latest
outputs:
version: ${{ steps.derive.outputs.version }}
packaging_dir: ${{ steps.derive.outputs.packaging_dir }}
rpm_matrix: ${{ steps.matrix.outputs.rpm }}
deb_matrix: ${{ steps.matrix.outputs.deb }}
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
sparse-checkout: |
.github/package-platforms.json
packaging/*/debian/changelog
sparse-checkout-cone-mode: false
- name: Validate version and derive packaging directory
id: derive
run: |
VERSION="${{ inputs.version }}"
# For pull_request triggers, detect version from the latest packaging changelog
if [ -z "$VERSION" ]; then
LATEST_DIR=$(ls -d packaging/[0-9]*/ 2>/dev/null | sort -V | tail -1)
if [ -n "$LATEST_DIR" ] && [ -f "${LATEST_DIR}debian/changelog" ]; then
VERSION=$(head -1 "${LATEST_DIR}debian/changelog" | sed 's/.*(\([^)]*\)).*/\1/' | sed 's/-.*//')
echo "No version input — detected ${VERSION} from ${LATEST_DIR}debian/changelog"
else
VERSION="8.1.1"
echo "No version input and no changelog found — using fallback ${VERSION}"
fi
fi
# Validate semver format: x.y.z or x.y.z-rcN
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
echo "ERROR: Invalid version format '${VERSION}'."
echo "Expected: x.y.z or x.y.z-rcN (e.g., 9.0.3, 8.1.0-rc1)"
exit 1
fi
VERSION_WITHOUT_RC="${VERSION%%-*}"
MAJOR="${VERSION_WITHOUT_RC%%.*}"
MINOR_PART="${VERSION_WITHOUT_RC#*.}"
MINOR="${MINOR_PART%%.*}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "packaging_dir=${MAJOR}.${MINOR}" >> "$GITHUB_OUTPUT"
echo "Version: ${VERSION}"
echo "Packaging directory: ${MAJOR}.${MINOR}"
- name: Generate platform matrices
id: matrix
run: |
CONFIG=".github/package-platforms.json"
echo "rpm=$(jq -c '.rpm' "$CONFIG")" >> "$GITHUB_OUTPUT"
echo "deb=$(jq -c '.deb' "$CONFIG")" >> "$GITHUB_OUTPUT"
############################################################################
# RPM Builds
############################################################################
build-rpm:
name: RPM · ${{ matrix.platform.name }} (${{ matrix.arch }}) · v${{ needs.process-inputs.outputs.version }}
needs: process-inputs
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.process-inputs.outputs.rpm_matrix) }}
steps:
- name: Checkout packaging repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Build RPM in container
run: |
DOCKER_PLATFORM="linux/${{ matrix.arch == 'aarch64' && 'arm64' || 'amd64' }}"
VALKEY_VERSION="${{ needs.process-inputs.outputs.version }}"
docker run --rm \
--platform="$DOCKER_PLATFORM" \
-e PLATFORM_FAMILY="${{ matrix.platform.family }}" \
-e PLATFORM_ID="${{ matrix.platform.id }}" \
-e EPEL_PACKAGE="${{ matrix.platform.epel }}" \
-e VALKEY_VERSION="${VALKEY_VERSION}" \
-e EXPECTED_ARCH="${{ matrix.arch }}" \
-v "${{ github.workspace }}/scripts:/scripts:ro" \
-v "${{ github.workspace }}/packaging/common/rpm:/packaging-common:ro" \
-v "${{ github.workspace }}/packaging/${{ needs.process-inputs.outputs.packaging_dir }}/rpm:/packaging-override:ro" \
-v "${{ github.workspace }}/packaging/templates/rpm:/packaging-templates:ro" \
-v "$(pwd)/output:/output" \
${{ matrix.platform.container }} \
bash /scripts/build-rpm.sh
- name: List built packages
run: |
echo "Built packages:"
ls -lh output/
- name: Upload RPM artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: valkey-rpms-${{ matrix.platform.id }}-${{ matrix.arch }}
path: output/*.rpm
retention-days: 30
############################################################################
# DEB Builds
############################################################################
build-deb:
name: DEB · ${{ matrix.platform.name }} (${{ matrix.arch }}) · v${{ needs.process-inputs.outputs.version }}
needs: process-inputs
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.process-inputs.outputs.deb_matrix) }}
steps:
- name: Checkout packaging repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up QEMU for cross-platform builds
if: matrix.arch == 'arm64' && runner.os == 'Linux' && runner.arch == 'X64'
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
platforms: arm64
- name: Build DEB in container
run: |
DOCKER_PLATFORM="linux/${{ matrix.arch }}"
VALKEY_VERSION="${{ needs.process-inputs.outputs.version }}"
docker run --rm \
--platform="$DOCKER_PLATFORM" \
-e PLATFORM_ID="${{ matrix.platform.id }}" \
-e PLATFORM_CODENAME="${{ matrix.platform.codename }}" \
-e VALKEY_VERSION="${VALKEY_VERSION}" \
-e EXPECTED_ARCH="${{ matrix.arch }}" \
-e DEBIAN_FRONTEND=noninteractive \
-v "${{ github.workspace }}/scripts:/scripts:ro" \
-v "${{ github.workspace }}/packaging/common/debian:/packaging-common:ro" \
-v "${{ github.workspace }}/packaging/${{ needs.process-inputs.outputs.packaging_dir }}/debian:/packaging-override:ro" \
-v "${{ github.workspace }}/packaging/templates/debian:/packaging-templates:ro" \
-v "$(pwd)/output:/output" \
${{ matrix.platform.container }} \
bash /scripts/build-deb.sh
- name: List built packages
run: |
echo "Built packages:"
ls -lh output/
echo ""
echo "Package details:"
for deb in output/*.deb; do
if [ -f "$deb" ]; then
echo "---"
echo "File: $(basename $deb)"
dpkg-deb --info "$deb" | grep -E "Package|Version|Architecture" || true
fi
done
- name: Upload DEB artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: valkey-debs-${{ matrix.platform.id }}-${{ matrix.arch }}
path: |
output/*.deb
output/*.ddeb
output/*.buildinfo
output/*.changes
retention-days: 30
############################################################################
# RPM Package Tests (all platforms)
############################################################################
test-rpm:
name: Test RPM · ${{ matrix.platform.name }} (${{ matrix.arch }}) · v${{ needs.process-inputs.outputs.version }}
needs: [process-inputs, build-rpm]
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.process-inputs.outputs.rpm_matrix) }}
steps:
- name: Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Download RPM artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: valkey-rpms-${{ matrix.platform.id }}-${{ matrix.arch }}
path: packages
- name: List downloaded packages
run: |
echo "Downloaded packages for ${{ matrix.platform.name }} (${{ matrix.arch }}):"
ls -lh packages/
- name: Run package tests in Docker
run: |
DOCKER_PLATFORM="linux/${{ matrix.arch == 'aarch64' && 'arm64' || 'amd64' }}"
VALKEY_VERSION="${{ needs.process-inputs.outputs.version }}"
CONTAINER_NAME="test-rpm-${{ matrix.platform.id }}-${{ matrix.arch }}"
# Phase 1: Install systemd in a plain container.
# Minimal container images don't ship /sbin/init, so start with
# "sleep infinity", install systemd, commit, then recreate with /sbin/init.
docker run -d \
--name "${CONTAINER_NAME}-setup" \
--platform="$DOCKER_PLATFORM" \
${{ matrix.platform.container }} \
sleep infinity
echo "Installing systemd prerequisites..."
if [ "${{ matrix.platform.family }}" = "suse" ]; then
docker exec "${CONTAINER_NAME}-setup" bash -c \
'zypper -n install -y systemd systemd-sysvinit procps iproute2 2>/dev/null'
else
docker exec "${CONTAINER_NAME}-setup" bash -c '
if command -v dnf5 &>/dev/null; then
dnf5 install -y systemd procps-ng iproute
elif command -v dnf &>/dev/null; then
dnf install -y systemd procps-ng iproute
else
yum install -y systemd procps-ng iproute
fi
# Mask makecache timers before systemd starts to prevent
# background cache operations from holding package manager locks
mkdir -p /etc/systemd/system
ln -sf /dev/null /etc/systemd/system/dnf-makecache.timer 2>/dev/null || true
ln -sf /dev/null /etc/systemd/system/dnf-makecache.service 2>/dev/null || true
ln -sf /dev/null /etc/systemd/system/dnf5-makecache.timer 2>/dev/null || true
ln -sf /dev/null /etc/systemd/system/dnf5-makecache.service 2>/dev/null || true
'
fi
# Ensure /sbin/init exists — some distros don't create it automatically
docker exec "${CONTAINER_NAME}-setup" bash -c '
if [ ! -e /sbin/init ]; then
ln -sf /usr/lib/systemd/systemd /sbin/init
fi
'
# Commit the container with systemd installed to a temporary image
docker commit "${CONTAINER_NAME}-setup" "${CONTAINER_NAME}-img"
docker rm -f "${CONTAINER_NAME}-setup" >/dev/null 2>&1
# Phase 2: Start a new container from the committed image with /sbin/init.
# --privileged is needed for systemd service hardening features
# (PrivateTmp, ProtectHome, etc.) which require mount namespacing.
docker create \
--name "$CONTAINER_NAME" \
--privileged \
--platform="$DOCKER_PLATFORM" \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
--cgroupns=host \
--tmpfs /run \
--tmpfs /run/lock \
"${CONTAINER_NAME}-img" \
/sbin/init
docker start "$CONTAINER_NAME"
echo "Waiting for systemd to initialize..."
for i in $(seq 1 60); do
if docker exec "$CONTAINER_NAME" systemctl is-system-running 2>/dev/null | grep -qE "running|degraded"; then
echo "systemd is ready (attempt $i)"
break
fi
if [ "$i" -eq 60 ]; then
echo "WARNING: systemd did not reach running state within 60 seconds"
docker exec "$CONTAINER_NAME" systemctl is-system-running 2>/dev/null || true
docker logs "$CONTAINER_NAME" 2>&1 | tail -20
fi
sleep 1
done
# Copy packages and test script into container
docker cp packages/. "$CONTAINER_NAME":/packages/
docker cp scripts/test_packages.sh "$CONTAINER_NAME":/test_packages.sh
# Run tests
echo ""
echo "============================================="
echo "Running tests on ${{ matrix.platform.name }} (${{ matrix.arch }})"
echo "Valkey version: $VALKEY_VERSION"
echo "============================================="
echo ""
docker exec "$CONTAINER_NAME" bash /test_packages.sh \
--pkg-dir=/packages \
--version="$VALKEY_VERSION"
TEST_EXIT=$?
# Cleanup
docker stop "$CONTAINER_NAME" >/dev/null 2>&1 || true
docker rm "$CONTAINER_NAME" >/dev/null 2>&1 || true
docker rmi "${CONTAINER_NAME}-img" >/dev/null 2>&1 || true
exit $TEST_EXIT
############################################################################
# DEB Package Tests (all platforms)
############################################################################
test-deb:
name: Test DEB · ${{ matrix.platform.name }} (${{ matrix.arch }}) · v${{ needs.process-inputs.outputs.version }}
needs: [process-inputs, build-deb]
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.process-inputs.outputs.deb_matrix) }}
steps:
- name: Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Download DEB artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: valkey-debs-${{ matrix.platform.id }}-${{ matrix.arch }}
path: packages
- name: List downloaded packages
run: |
echo "Downloaded packages for ${{ matrix.platform.name }} (${{ matrix.arch }}):"
ls -lh packages/
- name: Run package tests in Docker
run: |
DOCKER_PLATFORM="linux/${{ matrix.arch }}"
VALKEY_VERSION="${{ needs.process-inputs.outputs.version }}"
CONTAINER_NAME="test-deb-${{ matrix.platform.id }}-${{ matrix.arch }}"
# Phase 1: Install systemd prerequisites in a plain container.
# Debian/Ubuntu minimal images don't ship /sbin/init, so we start
# with "sleep infinity" first, install systemd, then recreate with /sbin/init.
docker run -d \
--name "${CONTAINER_NAME}-setup" \
--platform="$DOCKER_PLATFORM" \
${{ matrix.platform.container }} \
sleep infinity
echo "Installing systemd prerequisites..."
docker exec "${CONTAINER_NAME}-setup" bash -c '
apt-get update && apt-get install -y systemd systemd-sysv procps iproute2
# Mask units that interfere with container operation
mkdir -p /etc/systemd/system
ln -sf /dev/null /etc/systemd/system/apt-daily.timer 2>/dev/null || true
ln -sf /dev/null /etc/systemd/system/apt-daily-upgrade.timer 2>/dev/null || true
'
# Commit the container with systemd installed to a temporary image
docker commit "${CONTAINER_NAME}-setup" "${CONTAINER_NAME}-img"
docker rm -f "${CONTAINER_NAME}-setup" >/dev/null 2>&1
# Phase 2: Start a new container from the committed image with /sbin/init.
# --privileged is required for systemd v257+ (Debian 13+) which enforces
# stricter cgroup and security constraints.
docker create \
--name "$CONTAINER_NAME" \
--privileged \
--platform="$DOCKER_PLATFORM" \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
--cgroupns=host \
--tmpfs /run \
--tmpfs /run/lock \
"${CONTAINER_NAME}-img" \
/sbin/init
docker start "$CONTAINER_NAME"
echo "Waiting for systemd to initialize..."
for i in $(seq 1 60); do
if docker exec "$CONTAINER_NAME" systemctl is-system-running 2>/dev/null | grep -qE "running|degraded"; then
echo "systemd is ready (attempt $i)"
break
fi
if [ "$i" -eq 60 ]; then
echo "WARNING: systemd did not reach running state within 60 seconds"
docker exec "$CONTAINER_NAME" systemctl is-system-running 2>/dev/null || true
docker logs "$CONTAINER_NAME" 2>&1 | tail -20
fi
sleep 1
done
# Copy packages and test script into container
docker cp packages/. "$CONTAINER_NAME":/packages/
docker cp scripts/test_packages.sh "$CONTAINER_NAME":/test_packages.sh
# Run tests
echo ""
echo "============================================="
echo "Running tests on ${{ matrix.platform.name }} (${{ matrix.arch }})"
echo "Valkey version: $VALKEY_VERSION"
echo "============================================="
echo ""
docker exec "$CONTAINER_NAME" bash /test_packages.sh \
--pkg-dir=/packages \
--version="$VALKEY_VERSION"
TEST_EXIT=$?
# Cleanup
docker stop "$CONTAINER_NAME" >/dev/null 2>&1 || true
docker rm "$CONTAINER_NAME" >/dev/null 2>&1 || true
docker rmi "${CONTAINER_NAME}-img" >/dev/null 2>&1 || true
exit $TEST_EXIT
############################################################################
# Publish Packages to S3
############################################################################
publish-to-s3:
name: Publish to S3
needs: [process-inputs, build-rpm, build-deb, test-rpm, test-deb]
runs-on: ubuntu-latest
if: success() && github.event_name != 'pull_request'
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Download all build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: artifacts
- name: Install repository tools
run: |
sudo apt-get update && sudo apt-get install -y createrepo-c dpkg-dev debsigs gpg rpm
pip install awscli
- name: Import GPG signing key
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
id: gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.S3_REGION }}
- name: Sign packages and upload to S3
run: |
bash scripts/publish-to-s3.sh \
"${{ needs.process-inputs.outputs.version }}" \
"${{ steps.gpg.outputs.fingerprint }}" \
artifacts \
"${{ secrets.S3_BUCKET }}" \
"${{ secrets.S3_REGION }}"
############################################################################
# Deploy Install Instructions to GitHub Pages
############################################################################
deploy-pages:
name: Deploy Pages
needs: [process-inputs, publish-to-s3]
runs-on: ubuntu-latest
if: success() && github.event_name != 'pull_request'
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Checkout existing gh-pages content
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: gh-pages
path: site
continue-on-error: true
- name: Clean up site directory
run: |
mkdir -p site
cd site
# Remove non-Pages files (from bad orphan branch init)
rm -rf .git packaging scripts documents .github
rm -f README.md PACKAGING.md LICENSE
- name: Import GPG signing key
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
id: gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Install AWS CLI
run: pip install awscli
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.S3_REGION }}
- name: Generate site
run: |
PAGES_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
REPO_URL="https://download.valkey.io/packaging"
bash scripts/publish-repos.sh \
"${{ needs.process-inputs.outputs.version }}" \
"${{ steps.gpg.outputs.fingerprint }}" \
"${REPO_URL}" \
"${PAGES_URL}" \
"${{ secrets.S3_BUCKET }}" \
"${{ secrets.S3_REGION }}" \
site \
scripts/pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
publish_branch: gh-pages
keep_files: true
############################################################################
# Combined Summary
############################################################################
build-summary:
name: Build Summary
needs: [process-inputs, build-rpm, build-deb, test-rpm, test-deb, publish-to-s3, deploy-pages]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check build and test results
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
RPM_RESULT="${{ needs.build-rpm.result }}"
DEB_RESULT="${{ needs.build-deb.result }}"
RPM_TEST_RESULT="${{ needs.test-rpm.result }}"
DEB_TEST_RESULT="${{ needs.test-deb.result }}"
S3_RESULT="${{ needs.publish-to-s3.result }}"
PAGES_RESULT="${{ needs.deploy-pages.result }}"
echo "### Builds" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "$RPM_RESULT" = "success" ]; then
echo "- :white_check_mark: All RPM builds completed successfully" >> $GITHUB_STEP_SUMMARY
else
echo "- :x: Some RPM builds failed (status: $RPM_RESULT)" >> $GITHUB_STEP_SUMMARY
fi
if [ "$DEB_RESULT" = "success" ]; then
echo "- :white_check_mark: All DEB builds completed successfully" >> $GITHUB_STEP_SUMMARY
else
echo "- :x: Some DEB builds failed (status: $DEB_RESULT)" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Package Tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "$RPM_TEST_RESULT" = "success" ]; then
echo "- :white_check_mark: All RPM package tests passed" >> $GITHUB_STEP_SUMMARY
elif [ "$RPM_TEST_RESULT" = "skipped" ]; then
echo "- :warning: RPM package tests were skipped" >> $GITHUB_STEP_SUMMARY
else
echo "- :x: Some RPM package tests failed (status: $RPM_TEST_RESULT)" >> $GITHUB_STEP_SUMMARY
fi
if [ "$DEB_TEST_RESULT" = "success" ]; then
echo "- :white_check_mark: All DEB package tests passed" >> $GITHUB_STEP_SUMMARY
elif [ "$DEB_TEST_RESULT" = "skipped" ]; then
echo "- :warning: DEB package tests were skipped" >> $GITHUB_STEP_SUMMARY
else
echo "- :x: Some DEB package tests failed (status: $DEB_TEST_RESULT)" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Publishing" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "$S3_RESULT" = "success" ]; then
echo "- :white_check_mark: Packages published to S3" >> $GITHUB_STEP_SUMMARY
elif [ "$S3_RESULT" = "skipped" ]; then
echo "- :warning: S3 publishing was skipped" >> $GITHUB_STEP_SUMMARY
else
echo "- :x: S3 publishing failed (status: $S3_RESULT)" >> $GITHUB_STEP_SUMMARY
fi
if [ "$PAGES_RESULT" = "success" ]; then
echo "- :white_check_mark: Install instructions deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
elif [ "$PAGES_RESULT" = "skipped" ]; then
echo "- :warning: Pages deployment was skipped" >> $GITHUB_STEP_SUMMARY
else
echo "- :x: Pages deployment failed (status: $PAGES_RESULT)" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
FAILED=false
for result in "$RPM_RESULT" "$DEB_RESULT" "$RPM_TEST_RESULT" "$DEB_TEST_RESULT" "$S3_RESULT" "$PAGES_RESULT"; do
if [ "$result" != "success" ] && [ "$result" != "skipped" ]; then
FAILED=true
fi
done
if [ "$FAILED" = "true" ]; then
exit 1
fi
- name: Download all artifacts
if: success()
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: all-packages
- name: Generate artifact summary
if: success()
run: |
echo "## Built RPM Packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Architecture | Version | Packages | Total Size |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------------|---------|----------|------------|" >> $GITHUB_STEP_SUMMARY
VERSION="${{ needs.process-inputs.outputs.version }}"
for dir in all-packages/valkey-rpms-*/; do
if [ -d "$dir" ]; then
artifact=$(basename "$dir" | sed 's/valkey-rpms-//')
arch=$(echo "$artifact" | rev | cut -d'-' -f1 | rev)
platform=$(echo "$artifact" | rev | cut -d'-' -f2- | rev)
count=$(find "$dir" -name "*.rpm" -type f | wc -l)
size=$(du -sh "$dir" | cut -f1)
echo "| $platform | $arch | $VERSION | $count | $size |" >> $GITHUB_STEP_SUMMARY
fi
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Built DEB Packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Architecture | Version | Packages | Total Size |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------------|---------|----------|------------|" >> $GITHUB_STEP_SUMMARY
for dir in all-packages/valkey-debs-*/; do
if [ -d "$dir" ]; then
artifact=$(basename "$dir" | sed 's/valkey-debs-//')
arch=$(echo "$artifact" | rev | cut -d'-' -f1 | rev)
platform=$(echo "$artifact" | rev | cut -d'-' -f2- | rev)
count=$(find "$dir" -name "*.deb" -type f | wc -l)
size=$(du -sh "$dir" | cut -f1)
echo "| $platform | $arch | $VERSION | $count | $size |" >> $GITHUB_STEP_SUMMARY
fi
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "Artifacts are available for download in the Actions tab." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
PAGES_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
REPO_URL="https://download.valkey.io/packaging"
echo ":package: **Package repository (S3):** ${REPO_URL}" >> $GITHUB_STEP_SUMMARY
echo ":globe_with_meridians: **Install instructions:** [${PAGES_URL}](${PAGES_URL})" >> $GITHUB_STEP_SUMMARY