2023-12-07 09:45:34 +01:00
|
|
|
name: perl-keepass-reader
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "dependencies/perl-keepass-reader/**"
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
- dev-[2-9][0-9].[0-9][0-9].x
|
|
|
|
- master
|
|
|
|
- "[2-9][0-9].[0-9][0-9].x"
|
|
|
|
paths:
|
|
|
|
- "dependencies/perl-keepass-reader/**"
|
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
env:
|
|
|
|
module_name: perl-keepass-reader
|
|
|
|
|
2023-12-07 09:45:34 +01:00
|
|
|
jobs:
|
|
|
|
get-environment:
|
|
|
|
uses: ./.github/workflows/get-environment.yml
|
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
package:
|
2023-12-07 09:45:34 +01:00
|
|
|
needs: [get-environment]
|
|
|
|
|
|
|
|
strategy:
|
2024-02-14 16:43:06 +01:00
|
|
|
fail-fast: false
|
2023-12-07 09:45:34 +01:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- image: packaging-plugins-alma8
|
|
|
|
distrib: el8
|
2024-02-14 16:43:06 +01:00
|
|
|
package_extension: rpm
|
2023-12-07 09:45:34 +01:00
|
|
|
- image: packaging-plugins-alma9
|
|
|
|
distrib: el9
|
2024-02-14 16:43:06 +01:00
|
|
|
package_extension: rpm
|
|
|
|
- image: packaging-plugins-bullseye
|
|
|
|
distrib: bullseye
|
|
|
|
package_extension: deb
|
|
|
|
- image: packaging-plugins-bookworm
|
|
|
|
distrib: bookworm
|
|
|
|
package_extension: deb
|
|
|
|
- image: packaging-plugins-jammy
|
|
|
|
distrib: jammy
|
|
|
|
package_extension: deb
|
2023-12-07 09:45:34 +01:00
|
|
|
|
|
|
|
runs-on: ubuntu-22.04
|
2024-02-14 16:43:06 +01:00
|
|
|
|
2023-12-07 09:45:34 +01:00
|
|
|
container:
|
2024-02-14 16:43:06 +01:00
|
|
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
2023-12-07 09:45:34 +01:00
|
|
|
credentials:
|
2024-10-30 13:36:00 +01:00
|
|
|
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
|
|
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
2023-12-07 09:45:34 +01:00
|
|
|
|
|
|
|
name: package ${{ matrix.distrib }}
|
|
|
|
|
|
|
|
steps:
|
2024-02-14 16:43:06 +01:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 09:45:34 +01:00
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
- name: Build library
|
|
|
|
run: |
|
|
|
|
if [[ "${{ matrix.package_extension }}" == "rpm" ]]; then
|
|
|
|
dnf install -y make perl
|
|
|
|
else
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y make perl
|
|
|
|
fi
|
2023-12-07 09:45:34 +01:00
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
cd dependencies/perl-keepass-reader/src
|
|
|
|
perl Makefile.PL INSTALL_BASE=/tmp/perl-keepass-reader
|
|
|
|
make
|
|
|
|
make pure_install
|
|
|
|
shell: bash
|
2023-12-07 09:45:34 +01:00
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
- name: Set package name and paths according to distrib
|
|
|
|
run: |
|
2024-02-15 15:42:53 +01:00
|
|
|
PERL_VERSION=$(perl -E "say $^V" | sed -E "s/v([0-9]+\.[0-9]+).+/\1/g")
|
|
|
|
|
|
|
|
echo "Perl version is $PERL_VERSION"
|
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
|
|
|
NAME="libkeepass-reader-perl"
|
|
|
|
PERL_VENDORLIB="/usr/share/perl5"
|
|
|
|
else
|
|
|
|
NAME="perl-KeePass-Reader"
|
|
|
|
if [[ "${{ matrix.distrib }}" == "el8" ]]; then
|
|
|
|
PERL_VENDORLIB="/usr/local/share/perl5"
|
|
|
|
else
|
2024-02-15 15:42:53 +01:00
|
|
|
PERL_VENDORLIB="/usr/local/share/perl5/$PERL_VERSION"
|
2024-02-14 16:43:06 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed -i "s/@NAME@/$NAME/g" dependencies/perl-keepass-reader/packaging/perl-keepass-reader.yaml
|
|
|
|
sed -i "s#@PERL_VENDORLIB@#$PERL_VENDORLIB#g" dependencies/perl-keepass-reader/packaging/perl-keepass-reader.yaml
|
|
|
|
|
|
|
|
cat dependencies/perl-keepass-reader/packaging/perl-keepass-reader.yaml
|
2023-12-07 09:45:34 +01:00
|
|
|
shell: bash
|
|
|
|
|
2024-02-14 16:43:06 +01:00
|
|
|
- name: Package
|
|
|
|
uses: ./.github/actions/package-nfpm
|
2023-12-07 09:45:34 +01:00
|
|
|
with:
|
2024-02-14 16:43:06 +01:00
|
|
|
nfpm_file_pattern: "dependencies/perl-keepass-reader/packaging/perl-keepass-reader.yaml"
|
|
|
|
distrib: ${{ matrix.distrib }}
|
|
|
|
package_extension: ${{ matrix.package_extension }}
|
|
|
|
version: "0.2"
|
2024-02-15 15:42:53 +01:00
|
|
|
release: "3"
|
2024-02-14 16:43:06 +01:00
|
|
|
arch: all
|
|
|
|
commit_hash: ${{ github.sha }}
|
|
|
|
cache_key: cache-${{ github.run_id }}-${{ matrix.package_extension }}-${{ env.module_name }}-${{ matrix.distrib }}
|
|
|
|
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
|
|
|
|
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
|
|
|
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
|
|
|
stability: ${{ needs.get-environment.outputs.stability }}
|
2023-12-07 09:45:34 +01:00
|
|
|
|
2024-11-14 13:38:52 +01:00
|
|
|
deliver-packages:
|
2024-02-14 16:43:06 +01:00
|
|
|
needs: [get-environment, package]
|
2024-11-14 13:38:52 +01:00
|
|
|
if: |
|
|
|
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
|
|
|
! cancelled() &&
|
|
|
|
! contains(needs.*.result, 'failure') &&
|
|
|
|
! contains(needs.*.result, 'cancelled')
|
|
|
|
runs-on: ubuntu-24.04
|
2023-12-07 09:45:34 +01:00
|
|
|
strategy:
|
2024-11-14 13:38:52 +01:00
|
|
|
fail-fast: false
|
2023-12-07 09:45:34 +01:00
|
|
|
matrix:
|
2024-11-14 13:38:52 +01:00
|
|
|
include:
|
|
|
|
- distrib: el8
|
|
|
|
package_extension: rpm
|
|
|
|
- distrib: el9
|
|
|
|
package_extension: rpm
|
|
|
|
- distrib: bullseye
|
|
|
|
package_extension: deb
|
|
|
|
- distrib: bookworm
|
|
|
|
package_extension: deb
|
|
|
|
- distrib: jammy
|
|
|
|
package_extension: deb
|
2024-02-14 16:43:06 +01:00
|
|
|
|
2024-11-14 13:38:52 +01:00
|
|
|
name: deliver ${{ matrix.distrib }}
|
2023-12-07 09:45:34 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
2024-11-14 13:38:52 +01:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2023-12-07 09:45:34 +01:00
|
|
|
|
|
|
|
- name: Delivery
|
2024-11-14 13:38:52 +01:00
|
|
|
uses: ./.github/actions/package-delivery
|
2023-12-07 09:45:34 +01:00
|
|
|
with:
|
2024-02-14 16:43:06 +01:00
|
|
|
module_name: ${{ env.module_name }}
|
2023-12-07 09:45:34 +01:00
|
|
|
distrib: ${{ matrix.distrib }}
|
2024-11-14 13:38:52 +01:00
|
|
|
cache_key: cache-${{ github.run_id }}-${{ matrix.package_extension }}-${{ env.module_name }}-${{ matrix.distrib }}
|
2023-12-07 09:45:34 +01:00
|
|
|
stability: ${{ needs.get-environment.outputs.stability }}
|
2024-11-14 13:38:52 +01:00
|
|
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
2023-12-07 09:45:34 +01:00
|
|
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|