-
Notifications
You must be signed in to change notification settings - Fork 277
526 lines (466 loc) · 17.5 KB
/
perl-cpan-libraries.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
name: perl-cpan-libraries
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/perl-cpan-libraries.yml"
push:
branches:
- develop
- dev-[2-9][0-9].[0-9][0-9].x
- master
- "[2-9][0-9].[0-9][0-9].x"
paths:
- ".github/workflows/perl-cpan-libraries.yml"
jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
package-rpm:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
distrib: [el8, el9]
name:
[
"Authen::SASL::SASLprep",
"Authen::SCRAM::Client",
"boolean",
"BSON",
"BSON::XS",
"Carp::Assert",
"Clone",
"Clone::Choose",
"common::sense",
"Convert::Binary::C",
"Convert::EBCDIC",
"Crypt::Blowfish_PP",
"DateTime::Format::Duration::ISO8601",
"DBD::Sybase",
"Device::Modbus",
"Device::Modbus::RTU::Client",
"Device::Modbus::TCP::Client",
"Digest::MD5::File",
"Digest::SHA1",
"Email::Send::SMTP::Gmail",
"EV",
"FFI::CheckLib",
"FFI::Platypus",
"File::SearchPath",
"Hash::Merge",
"Hash::Ordered",
"HTTP::Daemon",
"HTTP::Daemon::SSL",
"HTTP::ProxyPAC",
"JMX::Jmx4Perl",
"JSON::Parse",
"JSON::WebToken",
"LV",
"MIME::Types",
"MongoDB",
"Net::DHCP",
"Net::FTPSSL",
"Net::HTTPTunnel",
"Net::NTP",
"Net::SMTPS",
"Net::SMTP_auth",
"Net::Subnet",
"Net::TFTP",
"PBKDF2::Tiny",
"Schedule::Cron",
"Statistics::Descriptive",
"Statistics::Regression",
"Sys::SigAction",
"Term::Clui",
"Term::ShellUI",
"Unicode::Stringprep",
"URI::Encode",
"URI::Template",
"URL::Encode",
"UUID",
"UUID::URandom",
"WWW::Selenium",
"XML::Filter::BufferText",
"XML::LibXML::Simple",
"XML::SAX::Writer",
"ZMQ::Constants",
"ZMQ::FFI",
"ZMQ::LibZMQ4"
]
include:
- build_distribs: "el8,el9"
- rpm_dependencies: ""
- rpm_provides: ""
- version: ""
- use_dh_make_perl: "true"
- spec_file: ""
- distrib: el8
package_extension: rpm
image: packaging-plugins-alma8
- distrib: el9
package_extension: rpm
image: packaging-plugins-alma9
- name: "BSON"
rpm_provides: "perl(BSON::Bytes) perl(BSON::Code) perl(BSON::DBRef) perl(BSON::OID) perl(BSON::Raw) perl(BSON::Regex) perl(BSON::Time) perl(BSON::Timestamp) perl(BSON::Types) perl(BSON)"
- name: "BSON::XS"
- name: "Convert::Binary::C"
- name: "DateTime::Format::Duration::ISO8601"
rpm_provides: "perl(DateTime-Format-Duration-ISO8601)"
- name: "DBD::Sybase"
- name: "Device::Modbus::RTU::Client"
version: "0.022"
- name: "Device::Modbus::TCP::Client"
version: "0.026"
- name: "EV"
- name: "FFI::CheckLib"
- name: "FFI::Platypus"
rpm_provides: "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)"
- name: "Net::DHCP"
rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)"
- name: "Statistics::Regression"
version: "0.53"
- name: "UUID"
use_dh_make_perl: "false"
version: "0.31"
- name: "ZMQ::Constants"
build_distribs: "el9"
- name: "ZMQ::FFI"
rpm_dependencies: "zeromq"
- name: "ZMQ::LibZMQ4"
use_dh_make_perl: "false"
version: "0.01"
rpm_dependencies: "zeromq"
name: package ${{ matrix.distrib }} ${{ matrix.name }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
run: |
yum install -y yum-utils epel-release git
yum config-manager --set-enabled crb || true # alma 9
yum config-manager --set-enabled powertools || true # alma 8
yum install -y cpanminus rpm-build libcurl-devel libssh-devel expat-devel gcc ruby libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file == '' }}
run: |
if [ -z "${{ matrix.version }}" ]; then
PACKAGE_VERSION=""
else
PACKAGE_VERSION=" -v ${{ matrix.version }}"
fi
if [ -z "${{ matrix.rpm_dependencies }}" ]; then
PACKAGE_DEPENDENCIES=""
else
for PACKAGE_DEPENDENCY in `echo ${{ matrix.rpm_dependencies }}`; do
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
done
fi
if [ -z "${{ matrix.rpm_provides }}" ]; then
PACKAGE_PROVIDES=""
else
for PACKAGE_PROVIDE in `echo "${{ matrix.rpm_provides }}"`; do
PACKAGE_PROVIDES="$PACKAGE_PROVIDES --provides $PACKAGE_PROVIDE"
done
fi
cpanm Module::Build::Tiny
cpanm Module::Install
export SYBASE="/usr"
gem install fpm
fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION ${{ matrix.name }}
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file != '' }}
run: |
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
rpmbuild --undefine=_disable_source_fetch -ba ${{ matrix.spec_file }}
cp -r ~/rpmbuild/RPMS/noarch/*.rpm .
shell: bash
- name: Replace '::' with - in the feature path
id: package-name
run: |
name="${{ matrix.name }}"
name_with_dash="${name//::/-}"
echo "Modified Name: $name_with_dash"
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
path: ./*.${{ matrix.package_extension }}
retention-days: 1
package-deb:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
distrib: [bullseye, bookworm, jammy]
name:
[
"Authen::SASL::SASLprep",
"Authen::SCRAM::Client",
"boolean",
"Carp::Assert",
"Clone",
"Clone::Choose",
"common::sense",
"Convert::EBCDIC",
"Crypt::Blowfish_PP",
"DateTime::Format::Duration::ISO8601",
"Device::Modbus",
"Digest::MD5::File",
"Digest::SHA1",
"Email::Send::SMTP::Gmail",
"FFI::CheckLib",
"File::SearchPath",
"Hash::Merge",
"Hash::Ordered",
"HTTP::Daemon",
"HTTP::Daemon::SSL",
"HTTP::ProxyPAC",
"JMX::Jmx4Perl",
"JSON::Parse",
"JSON::WebToken",
"LV",
"MIME::Types",
"MongoDB",
"Net::FTPSSL",
"Net::HTTPTunnel",
"Net::NTP",
"Net::SMTPS",
"Net::SMTP_auth",
"Net::Subnet",
"Net::TFTP",
"PBKDF2::Tiny",
"Schedule::Cron",
"Statistics::Descriptive",
"Statistics::Regression",
"Sys::SigAction",
"Term::Clui",
"Term::ShellUI",
"Unicode::Stringprep",
"URI::Encode",
"URI::Template",
"URL::Encode",
"UUID::URandom",
"WWW::Selenium",
"XML::Filter::BufferText",
"XML::LibXML::Simple",
"XML::SAX::Writer",
"ZMQ::Constants",
"ZMQ::LibZMQ4"
]
include:
- build_distribs: "bullseye,bookworm,jammy"
- deb_dependencies: ""
- rpm_provides: ""
- version: ""
- use_dh_make_perl: "true"
- spec_file: ""
- distrib: bullseye
package_extension: deb
image: packaging-plugins-bullseye
- distrib: bookworm
package_extension: deb
image: packaging-plugins-bookworm
- distrib: jammy
package_extension: deb
image: packaging-plugins-jammy
- name: "DateTime::Format::Duration::ISO8601"
- name: "Statistics::Regression"
version: "0.53"
- name: "ZMQ::Constants"
- name: "ZMQ::LibZMQ4"
use_dh_make_perl: "false"
version: "0.01"
deb_dependencies: "libzmq5"
name: package ${{ matrix.distrib }} ${{ matrix.name }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'false' }}
run: |
apt update
apt install -y cpanminus ruby libcurl4-openssl-dev libssh-dev uuid-dev libczmq-dev
PACKAGE_NAME=`echo ${{ matrix.name }} | sed -e 's/::/-/g' | tr '[A-Z]' '[a-z]' | sed -e 's/^/lib/g' | sed -e 's/$/-perl/g' | sed -e 's/liblib/lib/g'`
if [ -z "${{ matrix.version }}" ]; then
PACKAGE_VERSION=""
else
PACKAGE_VERSION=" -v ${{ matrix.version }}"
fi
if [ -z "${{ matrix.deb_dependencies }}" ]; then
PACKAGE_DEPENDENCIES=""
else
for PACKAGE_DEPENDENCY in `echo ${{ matrix.deb_dependencies }}`; do
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
done
fi
cpanm Module::Build::Tiny
cpanm Module::Install
gem install fpm
fpm -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test -n $PACKAGE_NAME$PACKAGE_DEPENDENCIES$PACKAGE_VERSION ${{ matrix.name }}
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'true' }}
run: |
apt update
apt install -y cpanminus libcurl4-openssl-dev dh-make-perl libssh-dev uuid-dev libczmq-dev libmodule-install-perl
if [ -z "${{ matrix.version }}" ]; then
PACKAGE_VERSION=""
else
PACKAGE_VERSION="--version ${{ matrix.version }}-${{ matrix.distrib }}"
fi
DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --build $PACKAGE_VERSION --cpan ${{ matrix.name }}
shell: bash
- name: Replace '::' with - in the feature path
id: package-name
run: |
name="${{ matrix.name }}"
name_with_dash="${name//::/-}"
echo "Modified Name: $name_with_dash"
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash}}
path: ./*.${{ matrix.package_extension }}
retention-days: 1
merge-package-rpm-artifacts:
needs: [package-rpm]
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [el8, el9]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
with:
target_name: packages-rpm-${{ matrix.distrib }}
source_paths: packages-rpm-${{ matrix.distrib }}/*.rpm
source_name_pattern: packages-rpm-${{ matrix.distrib }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
merge-package-deb-artifacts:
needs: [package-deb]
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
with:
target_name: packages-deb-${{ matrix.distrib }}
source_paths: packages-deb-${{ matrix.distrib }}/*.deb
source_name_pattern: packages-deb-${{ matrix.distrib }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
sign-rpm:
needs: [package-rpm, merge-package-rpm-artifacts]
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [el8, el9]
name: sign rpm ${{ matrix.distrib }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/rpm-signing:ubuntu
options: -t
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
steps:
- run: apt-get install -y zstd
shell: bash
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: packages-rpm-${{ matrix.distrib }}
path: ./
- run: echo "HOME=/root" >> $GITHUB_ENV
shell: bash
- run: rpmsign --addsign ./*.rpm
shell: bash
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ./*.rpm
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
download-and-cache-deb:
needs: [package-deb, merge-package-deb-artifacts]
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: packages-deb-${{ matrix.distrib }}
path: ./
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ./*.deb
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
deliver-rpm:
needs: [get-environment, sign-rpm]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/rpm-delivery
with:
module_name: perl-cpan-libraries
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
deliver-deb:
needs: [get-environment, download-and-cache-deb]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/deb-delivery
with:
module_name: perl-cpan-libraries
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
promote:
needs: [get-environment]
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9, bullseye, bookworm]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Promote ${{ matrix.distrib }} to stable
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module: perl-cpan-libraries
distrib: ${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}