This commit is contained in:
a-eljazouly 2024-02-06 10:22:45 +01:00
parent cd44c7dac4
commit 2e7abd702e
1 changed files with 190 additions and 190 deletions

View File

@ -215,162 +215,162 @@ jobs:
path: ./*.${{ matrix.package_extension }} path: ./*.${{ matrix.package_extension }}
retention-days: 1 retention-days: 1
package-deb: # package-deb:
needs: [get-environment] # needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }} # if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
strategy: # strategy:
fail-fast: false # fail-fast: false
matrix: # matrix:
distrib: [bullseye, bookworm, jammy] # distrib: [bullseye, bookworm, jammy]
name: # name:
[ # [
"Authen::SASL::SASLprep", # "Authen::SASL::SASLprep",
"Authen::SCRAM::Client", # "Authen::SCRAM::Client",
"boolean", # "boolean",
"Carp::Assert", # "Carp::Assert",
"Clone", # "Clone",
"Clone::Choose", # "Clone::Choose",
"common::sense", # "common::sense",
"Convert::EBCDIC", # "Convert::EBCDIC",
"Crypt::Blowfish_PP", # "Crypt::Blowfish_PP",
"DateTime::Format::Duration::ISO8601", # "DateTime::Format::Duration::ISO8601",
"Device::Modbus", # "Device::Modbus",
"Digest::MD5::File", # "Digest::MD5::File",
"Digest::SHA1", # "Digest::SHA1",
"Email::Send::SMTP::Gmail", # "Email::Send::SMTP::Gmail",
"FFI::CheckLib", # "FFI::CheckLib",
"File::SearchPath", # "File::SearchPath",
"Hash::Merge", # "Hash::Merge",
"Hash::Ordered", # "Hash::Ordered",
"HTTP::Daemon", # "HTTP::Daemon",
"HTTP::Daemon::SSL", # "HTTP::Daemon::SSL",
"HTTP::ProxyPAC", # "HTTP::ProxyPAC",
"JMX::Jmx4Perl", # "JMX::Jmx4Perl",
"JSON::Parse", # "JSON::Parse",
"JSON::WebToken", # "JSON::WebToken",
"LV", # "LV",
"MIME::Types", # "MIME::Types",
"MongoDB", # "MongoDB",
"Net::FTPSSL", # "Net::FTPSSL",
"Net::HTTPTunnel", # "Net::HTTPTunnel",
"Net::NTP", # "Net::NTP",
"Net::SMTPS", # "Net::SMTPS",
"Net::SMTP_auth", # "Net::SMTP_auth",
"Net::Subnet", # "Net::Subnet",
"Net::TFTP", # "Net::TFTP",
"PBKDF2::Tiny", # "PBKDF2::Tiny",
"Schedule::Cron", # "Schedule::Cron",
"Statistics::Descriptive", # "Statistics::Descriptive",
"Statistics::Regression", # "Statistics::Regression",
"Sys::SigAction", # "Sys::SigAction",
"Term::Clui", # "Term::Clui",
"Term::ShellUI", # "Term::ShellUI",
"Unicode::Stringprep", # "Unicode::Stringprep",
"URI::Encode", # "URI::Encode",
"URI::Template", # "URI::Template",
"URL::Encode", # "URL::Encode",
"UUID::URandom", # "UUID::URandom",
"WWW::Selenium", # "WWW::Selenium",
"XML::Filter::BufferText", # "XML::Filter::BufferText",
"XML::LibXML::Simple", # "XML::LibXML::Simple",
"XML::SAX::Writer", # "XML::SAX::Writer",
"ZMQ::Constants", # "ZMQ::Constants",
"ZMQ::LibZMQ4" # "ZMQ::LibZMQ4"
] # ]
include: # include:
- build_distribs: "bullseye,bookworm,jammy" # - build_distribs: "bullseye,bookworm,jammy"
- deb_dependencies: "" # - deb_dependencies: ""
- rpm_provides: "" # - rpm_provides: ""
- version: "" # - version: ""
- use_dh_make_perl: "true" # - use_dh_make_perl: "true"
- spec_file: "" # - spec_file: ""
- distrib: bullseye # - distrib: bullseye
package_extension: deb # package_extension: deb
image: packaging-plugins-bullseye # image: packaging-plugins-bullseye
- distrib: bookworm # - distrib: bookworm
package_extension: deb # package_extension: deb
image: packaging-plugins-bookworm # image: packaging-plugins-bookworm
- distrib: jammy # - distrib: jammy
package_extension: deb # package_extension: deb
image: packaging-plugins-jammy # image: packaging-plugins-jammy
- name: "DateTime::Format::Duration::ISO8601" # - name: "DateTime::Format::Duration::ISO8601"
- name: "Statistics::Regression" # - name: "Statistics::Regression"
version: "0.53" # version: "0.53"
- name: "ZMQ::Constants" # - name: "ZMQ::Constants"
- name: "ZMQ::LibZMQ4" # - name: "ZMQ::LibZMQ4"
use_dh_make_perl: "false" # use_dh_make_perl: "false"
version: "0.01" # version: "0.01"
deb_dependencies: "libzmq5" # deb_dependencies: "libzmq5"
name: package ${{ matrix.distrib }} ${{ matrix.name }} # name: package ${{ matrix.distrib }} ${{ matrix.name }}
container: # container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest # image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials: # credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }} # username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} # password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
steps: # steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'false' }} # - if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'false' }}
run: | # run: |
apt update # apt update
apt install -y cpanminus ruby libcurl4-openssl-dev libssh-dev uuid-dev libczmq-dev # 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'` # 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 # if [ -z "${{ matrix.version }}" ]; then
PACKAGE_VERSION="" # PACKAGE_VERSION=""
else # else
PACKAGE_VERSION=" -v ${{ matrix.version }}" # PACKAGE_VERSION=" -v ${{ matrix.version }}"
fi # fi
if [ -z "${{ matrix.deb_dependencies }}" ]; then # if [ -z "${{ matrix.deb_dependencies }}" ]; then
PACKAGE_DEPENDENCIES="" # PACKAGE_DEPENDENCIES=""
else # else
for PACKAGE_DEPENDENCY in `echo ${{ matrix.deb_dependencies }}`; do # for PACKAGE_DEPENDENCY in `echo ${{ matrix.deb_dependencies }}`; do
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY" # PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
done # done
fi # fi
cpanm Module::Build::Tiny # cpanm Module::Build::Tiny
cpanm Module::Install # cpanm Module::Install
gem install fpm # 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 }} # 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 # shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'true' }} # - if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'true' }}
run: | # run: |
apt update # apt update
apt install -y cpanminus libcurl4-openssl-dev dh-make-perl libssh-dev uuid-dev libczmq-dev libmodule-install-perl # apt install -y cpanminus libcurl4-openssl-dev dh-make-perl libssh-dev uuid-dev libczmq-dev libmodule-install-perl
if [ -z "${{ matrix.version }}" ]; then # if [ -z "${{ matrix.version }}" ]; then
PACKAGE_VERSION="" # PACKAGE_VERSION=""
else # else
PACKAGE_VERSION="--version ${{ matrix.version }}-${{ matrix.distrib }}" # PACKAGE_VERSION="--version ${{ matrix.version }}-${{ matrix.distrib }}"
fi # fi
DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --build $PACKAGE_VERSION --cpan ${{ matrix.name }} # DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --build $PACKAGE_VERSION --cpan ${{ matrix.name }}
shell: bash # shell: bash
- name: Replace '::' with - in the feature path # - name: Replace '::' with - in the feature path
id: package-name # id: package-name
run: | # run: |
name="${{ matrix.name }}" # name="${{ matrix.name }}"
name_with_dash="${name//::/-}" # name_with_dash="${name//::/-}"
echo "Modified Name: $name_with_dash" # echo "Modified Name: $name_with_dash"
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT # echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
shell: bash # shell: bash
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 # - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with: # with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash}} # name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash}}
path: ./*.${{ matrix.package_extension }} # path: ./*.${{ matrix.package_extension }}
retention-days: 1 # retention-days: 1
merge-package-rpm-artifacts: merge-package-rpm-artifacts:
needs: [package-rpm, merge-package-deb-artifacts] needs: [package-rpm]
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
@ -388,24 +388,24 @@ jobs:
source_name_pattern: packages-rpm-${{ matrix.distrib }}- source_name_pattern: packages-rpm-${{ matrix.distrib }}-
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
merge-package-deb-artifacts: # merge-package-deb-artifacts:
needs: [package-deb] # needs: [package-deb]
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
strategy: # strategy:
matrix: # matrix:
distrib: [bullseye, bookworm, jammy] # distrib: [bullseye, bookworm, jammy]
steps: # steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Merging Artifacts # - name: Merging Artifacts
uses: ./.github/actions/merge-artifacts # uses: ./.github/actions/merge-artifacts
with: # with:
target_name: packages-deb-${{ matrix.distrib }} # target_name: packages-deb-${{ matrix.distrib }}
source_paths: packages-deb-${{ matrix.distrib }}/*.deb # source_paths: packages-deb-${{ matrix.distrib }}/*.deb
source_name_pattern: packages-deb-${{ matrix.distrib }}- # source_name_pattern: packages-deb-${{ matrix.distrib }}-
github_token: ${{ secrets.GITHUB_TOKEN }} # github_token: ${{ secrets.GITHUB_TOKEN }}
sign-rpm: sign-rpm:
needs: [package-rpm, merge-package-rpm-artifacts] needs: [package-rpm, merge-package-rpm-artifacts]
@ -444,22 +444,22 @@ jobs:
path: ./*.rpm path: ./*.rpm
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
download-and-cache-deb: # download-and-cache-deb:
needs: [package-deb, merge-package-deb-artifacts] # needs: [package-deb, merge-package-deb-artifacts]
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
strategy: # strategy:
matrix: # matrix:
distrib: [bullseye, bookworm, jammy] # distrib: [bullseye, bookworm, jammy]
steps: # steps:
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 # - uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with: # with:
name: packages-deb-${{ matrix.distrib }} # name: packages-deb-${{ matrix.distrib }}
path: ./ # path: ./
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 # - uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with: # with:
path: ./*.deb # path: ./*.deb
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} # key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
deliver-rpm: deliver-rpm:
needs: [get-environment, sign-rpm] needs: [get-environment, sign-rpm]
@ -483,27 +483,27 @@ jobs:
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }} stability: ${{ needs.get-environment.outputs.stability }}
deliver-deb: # deliver-deb:
needs: [get-environment, download-and-cache-deb] # needs: [get-environment, download-and-cache-deb]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} # if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common] # runs-on: [self-hosted, common]
strategy: # strategy:
matrix: # matrix:
distrib: [bullseye, bookworm, jammy] # distrib: [bullseye, bookworm, jammy]
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery # - name: Delivery
uses: ./.github/actions/deb-delivery # uses: ./.github/actions/deb-delivery
with: # with:
module_name: perl-cpan-libraries # module_name: perl-cpan-libraries
distrib: ${{ matrix.distrib }} # distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} # artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} # cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }} # stability: ${{ needs.get-environment.outputs.stability }}
promote: promote:
needs: [get-environment] needs: [get-environment]