-
-
Notifications
You must be signed in to change notification settings - Fork 1
989 lines (868 loc) · 32 KB
/
packaging.yml
File metadata and controls
989 lines (868 loc) · 32 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
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
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
name: Build Packages
on:
push:
branches: [main]
tags:
- 'v*'
paths:
- 'CMakeLists.txt'
- 'cmake/**'
- 'repo/**'
- 'src/**'
- 'include/**'
- 'bindings/**'
- 'docker/**'
- '.github/workflows/packaging.yml'
pull_request:
branches: [main]
paths:
- 'CMakeLists.txt'
- 'cmake/**'
- 'repo/**'
- 'src/**'
- 'include/**'
- 'bindings/**'
- 'docker/**'
- '.github/workflows/packaging.yml'
workflow_dispatch:
inputs:
publish:
description: 'Publish packages to repository'
required: false
default: false
type: boolean
env:
DOCKER_BUILDKIT: 1
jobs:
# ============================================================================
# Build DEB packages for Debian/Ubuntu
# ============================================================================
build-deb:
name: Build DEB (${{ matrix.distro }})
runs-on: ubuntu-latest
container: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-22.04
image: ubuntu:22.04
codename: jammy
- distro: ubuntu-24.04
image: ubuntu:24.04
codename: noble
- distro: debian-13
image: debian:trixie
codename: trixie
steps:
- name: Cache APT packages
uses: actions/cache@v5
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: apt-${{ matrix.distro }}-${{ hashFiles('.github/workflows/packaging.yml') }}
restore-keys: |
apt-${{ matrix.distro }}-
- name: Install dependencies
run: |
apt-get update
apt-get install -y \
build-essential \
cmake \
git \
file \
dpkg-dev \
debhelper
- name: Install GCC 13 (for older distros)
if: matrix.distro == 'ubuntu-22.04'
run: |
# Ubuntu 22.04: Add toolchain PPA for GCC 13
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install -y gcc-13 g++-13
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
gcc --version
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Cache CMake build
uses: actions/cache@v5
with:
path: |
build
~/.cache/ccache
key: cmake-deb-${{ matrix.distro }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'include/**') }}
restore-keys: |
cmake-deb-${{ matrix.distro }}-
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DBUILD_BENCHMARKS=OFF \
-DBUILD_GO_WRAPPER=OFF \
-DBUILD_CPP_WRAPPER=OFF
- name: Build
run: cmake --build build --parallel $(nproc)
- name: Build DEB packages
run: |
cd build
cpack -G DEB
ls -la *.deb
- name: Upload DEB artifacts
uses: actions/upload-artifact@v6
with:
name: deb-${{ matrix.codename }}
path: build/*.deb
retention-days: 7
# ============================================================================
# Build RPM packages for EL (Rocky/RHEL)
# ============================================================================
build-rpm-el:
name: Build RPM (EL ${{ matrix.version }})
runs-on: ubuntu-latest
container: rockylinux:${{ matrix.version }}
strategy:
fail-fast: false
matrix:
include:
- version: 8
family: el
- version: 9
family: el
steps:
- name: Cache DNF packages
uses: actions/cache@v5
with:
path: /var/cache/dnf
key: dnf-el${{ matrix.version }}-${{ hashFiles('.github/workflows/packaging.yml') }}
restore-keys: |
dnf-el${{ matrix.version }}-
- name: Install dependencies
run: |
# Enable EPEL and PowerTools/CRB for additional packages
dnf install -y epel-release
if [ "${{ matrix.version }}" = "8" ]; then
dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled PowerTools
else
dnf config-manager --set-enabled crb || dnf config-manager --set-enabled CRB
fi
dnf install -y \
gcc \
gcc-c++ \
cmake \
git \
rpm-build \
make
- name: Install GCC 13 (for EL systems)
run: |
if [ "${{ matrix.version }}" = "8" ]; then
# EL 8: Install GCC Toolset 13
dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++
echo "source /opt/rh/gcc-toolset-13/enable" >> ~/.bashrc
source /opt/rh/gcc-toolset-13/enable
elif [ "${{ matrix.version }}" = "9" ]; then
# EL 9: Install GCC Toolset 13
dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++
echo "source /opt/rh/gcc-toolset-13/enable" >> ~/.bashrc
source /opt/rh/gcc-toolset-13/enable
fi
gcc --version
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Cache CMake build
uses: actions/cache@v5
with:
path: |
build
~/.cache/ccache
key: cmake-rpm-el${{ matrix.version }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'include/**') }}
restore-keys: |
cmake-rpm-el${{ matrix.version }}-
- name: Configure CMake
run: |
# Enable GCC toolset for EL systems
if [ -f /opt/rh/gcc-toolset-13/enable ]; then
source /opt/rh/gcc-toolset-13/enable
fi
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DBUILD_BENCHMARKS=OFF \
-DBUILD_GO_WRAPPER=OFF \
-DBUILD_CPP_WRAPPER=OFF
- name: Build
run: |
# Enable GCC toolset for EL systems
if [ -f /opt/rh/gcc-toolset-13/enable ]; then
source /opt/rh/gcc-toolset-13/enable
fi
cmake --build build --parallel $(nproc)
- name: Build RPM packages
run: |
# Enable GCC toolset for EL systems
if [ -f /opt/rh/gcc-toolset-13/enable ]; then
source /opt/rh/gcc-toolset-13/enable
fi
cd build
cpack -G RPM
ls -la *.rpm
- name: Upload RPM artifacts
uses: actions/upload-artifact@v6
with:
name: rpm-el${{ matrix.version }}
path: build/*.rpm
retention-days: 7
# ============================================================================
# Build RPM packages for Fedora
# ============================================================================
build-rpm-fedora:
name: Build RPM (Fedora ${{ matrix.version }})
runs-on: ubuntu-latest
container: fedora:${{ matrix.version }}
strategy:
fail-fast: false
matrix:
include:
- version: 40
family: fedora
- version: 41
family: fedora
steps:
- name: Cache DNF packages
uses: actions/cache@v5
with:
path: /var/cache/dnf
key: dnf-fedora${{ matrix.version }}-${{ hashFiles('.github/workflows/packaging.yml') }}
restore-keys: |
dnf-fedora${{ matrix.version }}-
- name: Install dependencies
run: |
dnf install -y \
gcc \
gcc-c++ \
cmake \
git \
rpm-build \
make
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Cache CMake build
uses: actions/cache@v5
with:
path: |
build
~/.cache/ccache
key: cmake-rpm-fedora${{ matrix.version }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'include/**') }}
restore-keys: |
cmake-rpm-fedora${{ matrix.version }}-
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DBUILD_BENCHMARKS=OFF \
-DBUILD_GO_WRAPPER=OFF \
-DBUILD_CPP_WRAPPER=OFF
- name: Build
run: cmake --build build --parallel $(nproc)
- name: Build RPM packages
run: |
cd build
cpack -G RPM
ls -la *.rpm
- name: Upload RPM artifacts
uses: actions/upload-artifact@v6
with:
name: rpm-fedora${{ matrix.version }}
path: build/*.rpm
retention-days: 7
# ============================================================================
# Test package installation
# ============================================================================
test-deb-install:
name: Test DEB Install (${{ matrix.distro }})
needs: build-deb
runs-on: ubuntu-latest
container: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-22.04
image: ubuntu:22.04
codename: jammy
- distro: ubuntu-24.04
image: ubuntu:24.04
codename: noble
- distro: debian-13
image: debian:trixie
codename: trixie
steps:
- name: Download DEB artifacts
uses: actions/download-artifact@v6
with:
name: deb-${{ matrix.codename }}
path: packages
- name: Install packages
run: |
apt-get update
apt-get install -y ./packages/liblpm_*.deb ./packages/liblpm-dev_*.deb
- name: Verify installation
run: |
# Check library is installed
ldconfig -p | grep liblpm
# Check headers are installed
ls -la /usr/include/lpm/
# Check pkg-config
apt-get install -y pkg-config
pkg-config --modversion liblpm
pkg-config --libs liblpm
pkg-config --cflags liblpm
test-rpm-install:
name: Test RPM Install (EL ${{ matrix.version }})
needs: build-rpm-el
runs-on: ubuntu-latest
container: rockylinux:${{ matrix.version }}
strategy:
fail-fast: false
matrix:
include:
- version: 8
- version: 9
steps:
- name: Download RPM artifacts
uses: actions/download-artifact@v6
with:
name: rpm-el${{ matrix.version }}
path: packages
- name: Install packages
run: |
dnf install -y ./packages/liblpm-*.rpm ./packages/liblpm-devel-*.rpm
- name: Verify installation
run: |
# Check library is installed
ldconfig -p | grep liblpm
# Check headers are installed
ls -la /usr/include/lpm/
# Check pkg-config
dnf install -y pkgconfig
pkg-config --modversion liblpm
pkg-config --libs liblpm
pkg-config --cflags liblpm
# ============================================================================
# Build Python Wheel (Universal)
# ============================================================================
build-python-wheel:
name: Build Python Wheel
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Python wheel
run: |
docker build -f docker/Dockerfile.python -t liblpm-python \
--cache-from type=gha,scope=python-wheel \
--cache-to type=gha,mode=max,scope=python-wheel .
mkdir -p packages/python
docker run --rm -v "$PWD/packages/python:/artifacts" \
--entrypoint bash \
liblpm-python \
-c '. /opt/venv/bin/activate && cd /build/bindings/python && pip install -q build && python3 -m build --wheel --outdir /artifacts 2>&1'
ls -la packages/python/
- name: Upload Python wheel
uses: actions/upload-artifact@v6
with:
name: python-wheel
path: packages/python/*.whl
retention-days: 7
# ============================================================================
# Build Python DEB packages
# ============================================================================
build-python-deb:
name: Build Python DEB (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-22.04
target_distro: ubuntu
target_version: "22.04"
- distro: ubuntu-24.04
target_distro: ubuntu
target_version: "24.04"
- distro: debian-12
target_distro: debian
target_version: "12"
- distro: debian-13
target_distro: debian
target_version: "13"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Python DEB package
run: |
docker build -f docker/Dockerfile.python.deb \
--build-arg TARGET_DISTRO=${{ matrix.target_distro }} \
--build-arg TARGET_VERSION=${{ matrix.target_version }} \
--cache-from type=gha,scope=python-deb-${{ matrix.distro }} \
--cache-to type=gha,mode=max,scope=python-deb-${{ matrix.distro }} \
-t liblpm-python-deb:${{ matrix.distro }} .
mkdir -p packages/python-deb
docker run --rm \
-v "$PWD:/workspace" \
-v "$PWD/packages/python-deb:/packages" \
liblpm-python-deb:${{ matrix.distro }}
ls -la packages/python-deb/
- name: Upload Python DEB artifact
uses: actions/upload-artifact@v6
with:
name: python-deb-${{ matrix.distro }}
path: packages/python-deb/*.deb
retention-days: 7
# ============================================================================
# Build Python RPM packages
# ============================================================================
build-python-rpm:
name: Build Python RPM (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Note: Rocky Linux 9 has Python 3.9, liblpm requires 3.10+
# Only Fedora is supported for Python RPM
- distro: fedora-41
rpm_distro: fedora
rpm_version: "41"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Python RPM package
run: |
docker build -f docker/Dockerfile.python.rpm \
--build-arg DISTRO=${{ matrix.rpm_distro }} \
--build-arg VERSION=${{ matrix.rpm_version }} \
--cache-from type=gha,scope=python-rpm-${{ matrix.distro }} \
--cache-to type=gha,mode=max,scope=python-rpm-${{ matrix.distro }} \
-t liblpm-python-rpm:${{ matrix.distro }} .
mkdir -p packages/python-rpm
docker run --rm \
-v "$PWD:/workspace" \
-v "$PWD/packages/python-rpm:/packages" \
liblpm-python-rpm:${{ matrix.distro }}
ls -la packages/python-rpm/
- name: Upload Python RPM artifact
uses: actions/upload-artifact@v6
with:
name: python-rpm-${{ matrix.distro }}
path: packages/python-rpm/*.rpm
retention-days: 7
# ============================================================================
# Build PHP PECL package
# ============================================================================
build-php-pecl:
name: Build PHP PECL
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build PHP PECL package
run: |
docker build -f docker/Dockerfile.php.pecl -t liblpm-php-pecl \
--cache-from type=gha,scope=php-pecl \
--cache-to type=gha,mode=max,scope=php-pecl .
mkdir -p packages/php
docker run --rm -v "$PWD/packages/php:/artifacts" liblpm-php-pecl
ls -la packages/php/
- name: Upload PHP PECL artifact
uses: actions/upload-artifact@v6
with:
name: php-pecl
path: packages/php/*.tgz
retention-days: 7
# ============================================================================
# Build PHP DEB packages
# ============================================================================
build-php-deb:
name: Build PHP DEB (${{ matrix.distro }}, PHP ${{ matrix.php_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-22.04
target_distro: ubuntu
target_version: "22.04"
php_version: "8.1"
- distro: ubuntu-24.04
target_distro: ubuntu
target_version: "24.04"
php_version: "8.3"
- distro: debian-12
target_distro: debian
target_version: "12"
php_version: "8.2"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build PHP DEB package
run: |
docker build -f docker/Dockerfile.php.deb \
--build-arg PHP_VERSION=${{ matrix.php_version }} \
--build-arg TARGET_DISTRO=${{ matrix.target_distro }} \
--build-arg TARGET_VERSION=${{ matrix.target_version }} \
--cache-from type=gha,scope=php-deb-${{ matrix.distro }} \
--cache-to type=gha,mode=max,scope=php-deb-${{ matrix.distro }} \
-t liblpm-php-deb:${{ matrix.distro }} .
mkdir -p packages/php-deb
docker run --rm \
-v "$PWD:/workspace" \
-v "$PWD/packages/php-deb:/packages" \
liblpm-php-deb:${{ matrix.distro }}
ls -la packages/php-deb/
- name: Upload PHP DEB artifact
uses: actions/upload-artifact@v6
with:
name: php-deb-${{ matrix.distro }}
path: packages/php-deb/*.deb
retention-days: 7
# ============================================================================
# Build PHP RPM packages
# ============================================================================
build-php-rpm:
name: Build PHP RPM (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: rocky-9
rpm_distro: rockylinux
rpm_version: "9"
- distro: fedora-41
rpm_distro: fedora
rpm_version: "41"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build PHP RPM package
run: |
docker build -f docker/Dockerfile.php.rpm \
--build-arg DISTRO=${{ matrix.rpm_distro }} \
--build-arg VERSION=${{ matrix.rpm_version }} \
--cache-from type=gha,scope=php-rpm-${{ matrix.distro }} \
--cache-to type=gha,mode=max,scope=php-rpm-${{ matrix.distro }} \
-t liblpm-php-rpm:${{ matrix.distro }} .
mkdir -p packages/php-rpm
docker run --rm \
-v "$PWD:/workspace" \
-v "$PWD/packages/php-rpm:/packages" \
liblpm-php-rpm:${{ matrix.distro }}
ls -la packages/php-rpm/
- name: Upload PHP RPM artifact
uses: actions/upload-artifact@v6
with:
name: php-rpm-${{ matrix.distro }}
path: packages/php-rpm/*.rpm
retention-days: 7
# ============================================================================
# Build Perl DEB packages
# ============================================================================
build-perl-deb:
name: Build Perl DEB (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-22.04
target_distro: ubuntu
target_version: "22.04"
- distro: ubuntu-24.04
target_distro: ubuntu
target_version: "24.04"
- distro: debian-12
target_distro: debian
target_version: "12"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Perl DEB package
run: |
docker build -f docker/Dockerfile.perl.deb \
--build-arg TARGET_DISTRO=${{ matrix.target_distro }} \
--build-arg TARGET_VERSION=${{ matrix.target_version }} \
--cache-from type=gha,scope=perl-deb-${{ matrix.distro }} \
--cache-to type=gha,mode=max,scope=perl-deb-${{ matrix.distro }} \
-t liblpm-perl-deb:${{ matrix.distro }} .
mkdir -p packages/perl-deb
docker run --rm \
-v "$PWD:/workspace" \
-v "$PWD/packages/perl-deb:/packages" \
liblpm-perl-deb:${{ matrix.distro }}
ls -la packages/perl-deb/
- name: Upload Perl DEB artifact
uses: actions/upload-artifact@v6
with:
name: perl-deb-${{ matrix.distro }}
path: packages/perl-deb/*.deb
retention-days: 7
# ============================================================================
# Build Perl RPM packages
# ============================================================================
build-perl-rpm:
name: Build Perl RPM (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: rocky-9
rpm_distro: rockylinux
rpm_version: "9"
- distro: fedora-41
rpm_distro: fedora
rpm_version: "41"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Perl RPM package
run: |
docker build -f docker/Dockerfile.perl.rpm \
--build-arg DISTRO=${{ matrix.rpm_distro }} \
--build-arg VERSION=${{ matrix.rpm_version }} \
--cache-from type=gha,scope=perl-rpm-${{ matrix.distro }} \
--cache-to type=gha,mode=max,scope=perl-rpm-${{ matrix.distro }} \
-t liblpm-perl-rpm:${{ matrix.distro }} .
mkdir -p packages/perl-rpm
docker run --rm \
-v "$PWD:/workspace" \
-v "$PWD/packages/perl-rpm:/packages" \
liblpm-perl-rpm:${{ matrix.distro }}
ls -la packages/perl-rpm/
- name: Upload Perl RPM artifact
uses: actions/upload-artifact@v6
with:
name: perl-rpm-${{ matrix.distro }}
path: packages/perl-rpm/*.rpm
retention-days: 7
# ============================================================================
# Build Java JAR package
# ============================================================================
build-java-jar:
name: Build Java JAR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Java JAR
run: |
docker build -f docker/Dockerfile.java -t liblpm-java \
--cache-from type=gha,scope=java-jar \
--cache-to type=gha,mode=max,scope=java-jar .
mkdir -p packages/java
docker run --rm -v "$PWD/packages/java:/artifacts" \
--entrypoint sh \
liblpm-java \
-c 'find /app/build/libs -name "*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" -exec cp {} /artifacts/ \; 2>/dev/null || find /java/build/libs -name "*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" -exec cp {} /artifacts/ \;'
ls -la packages/java/
- name: Upload Java JAR artifact
uses: actions/upload-artifact@v6
with:
name: java-jar
path: packages/java/*.jar
retention-days: 7
# ============================================================================
# Build C# NuGet package
# ============================================================================
build-csharp-nuget:
name: Build C# NuGet
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build C# NuGet package
run: |
docker build -f docker/Dockerfile.csharp -t liblpm-csharp \
--cache-from type=gha,scope=csharp-nuget \
--cache-to type=gha,mode=max,scope=csharp-nuget .
mkdir -p packages/csharp
docker run --rm -v "$PWD/packages/csharp:/artifacts" \
--entrypoint bash \
liblpm-csharp \
-c 'cd /build/bindings/csharp/LibLpm && mkdir -p build && echo "<Project />" > build/LibLpm.targets && cd .. && dotnet pack LibLpm/LibLpm.csproj --configuration Release -o /artifacts 2>&1'
ls -la packages/csharp/
- name: Upload C# NuGet artifact
uses: actions/upload-artifact@v6
with:
name: csharp-nuget
path: packages/csharp/*.nupkg
retention-days: 7
# ============================================================================
# Build Go source tarball
# ============================================================================
build-go-tarball:
name: Build Go Tarball
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Go tarball
run: |
docker build -f docker/Dockerfile.go -t liblpm-go \
--cache-from type=gha,scope=go-tarball \
--cache-to type=gha,mode=max,scope=go-tarball .
mkdir -p packages/go
docker run --rm -v "$PWD/packages/go:/artifacts" \
--entrypoint bash \
liblpm-go \
-c 'cd /app && tar -czf /artifacts/liblpm-go-source.tar.gz --exclude=".git" --exclude="*.test" . 2>&1'
ls -la packages/go/
- name: Upload Go tarball artifact
uses: actions/upload-artifact@v6
with:
name: go-tarball
path: packages/go/*.tar.gz
retention-days: 7
# ============================================================================
# Build Lua module
# ============================================================================
build-lua-module:
name: Build Lua Module
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Lua module
run: |
docker build -f docker/Dockerfile.lua -t liblpm-lua \
--cache-from type=gha,scope=lua-module \
--cache-to type=gha,mode=max,scope=lua-module .
mkdir -p packages/lua
docker run --rm -v "$PWD/packages/lua:/artifacts" \
--entrypoint sh \
liblpm-lua \
-c 'find /usr/local/lib/lua -name "liblpm.so" -exec cp {} /artifacts/ \;'
ls -la packages/lua/
- name: Upload Lua module artifact
uses: actions/upload-artifact@v6
with:
name: lua-module
path: packages/lua/*.so
retention-days: 7
# ============================================================================
# Packaging Summary
# ============================================================================
packaging-summary:
name: Packaging Summary
runs-on: ubuntu-latest
needs:
- build-deb
- build-rpm-el
- build-rpm-fedora
- test-deb-install
- test-rpm-install
- build-python-wheel
- build-python-deb
- build-python-rpm
- build-php-pecl
- build-php-deb
- build-php-rpm
- build-perl-deb
- build-perl-rpm
- build-java-jar
- build-csharp-nuget
- build-go-tarball
- build-lua-module
if: always()
steps:
- name: Check packaging status
run: |
echo "## Packaging Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Native Packages" >> $GITHUB_STEP_SUMMARY
echo "| Package | Status |" >> $GITHUB_STEP_SUMMARY
echo "|---------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| DEB packages | ${{ needs.build-deb.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| RPM EL packages | ${{ needs.build-rpm-el.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| RPM Fedora packages | ${{ needs.build-rpm-fedora.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Language Bindings" >> $GITHUB_STEP_SUMMARY
echo "| Package | Status |" >> $GITHUB_STEP_SUMMARY
echo "|---------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Python Wheel | ${{ needs.build-python-wheel.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Python DEB | ${{ needs.build-python-deb.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Python RPM | ${{ needs.build-python-rpm.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| PHP PECL | ${{ needs.build-php-pecl.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| PHP DEB | ${{ needs.build-php-deb.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| PHP RPM | ${{ needs.build-php-rpm.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Perl DEB | ${{ needs.build-perl-deb.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Perl RPM | ${{ needs.build-perl-rpm.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Java JAR | ${{ needs.build-java-jar.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| C# NuGet | ${{ needs.build-csharp-nuget.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Go Tarball | ${{ needs.build-go-tarball.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Lua Module | ${{ needs.build-lua-module.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installation Tests" >> $GITHUB_STEP_SUMMARY
echo "| Test | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| DEB Install | ${{ needs.test-deb-install.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| RPM Install | ${{ needs.test-rpm-install.result }} |" >> $GITHUB_STEP_SUMMARY