centreon-plugins/.github/workflows/perl-filesys-smbclient.yml

193 lines
6.4 KiB
YAML

name: perl-filesys-smbclient
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
paths:
- "dependencies/perl-filesys-smbclient/**"
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-filesys-smbclient/**"
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:
matrix:
include:
- image: packaging-plugins-alma8
distrib: el8
- image: packaging-plugins-alma9
distrib: el9
name: package ${{ matrix.distrib }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials:
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
yum install -y yum-utils
yum config-manager --set-enabled crb || true # alma 9
yum config-manager --set-enabled powertools || true # alma 8
yum install -y libsmbclient-devel make gcc perl perl-devel perl-ExtUtils-MakeMaker
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp -rp dependencies/perl-filesys-smbclient/src perl-Filesys-SmbClient/
tar czf ~/rpmbuild/SOURCES/perl-Filesys-SmbClient.tar.gz perl-Filesys-SmbClient
rpmbuild -ba dependencies/perl-filesys-smbclient/packaging/rpm/perl-Filesys-SmbClient.spec
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
shell: bash
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.rpm
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
sign-rpm:
needs: [package-rpm]
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- image: packaging-alma8
distrib: el8
- image: packaging-alma9
distrib: el9
name: sign rpm ${{ matrix.distrib }}
container:
image: docker.centreon.com/centreon-private/rpm-signing:latest
options: -t
credentials:
username: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_USERNAME }}
password: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_TOKEN }}
steps:
- run: |
apt-get update
apt-get install -y zstd
shell: bash
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.rpm
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
- run: echo "HOME=/root" >> $GITHUB_ENV
shell: bash
- run: rpmsign --addsign ./*.rpm
shell: bash
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.rpm
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
package-deb:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- image: packaging-plugins-bullseye
distrib: bullseye
- image: packaging-plugins-bookworm
distrib: bookworm
- image: packaging-plugins-jammy
distrib: jammy
name: package ${{ matrix.distrib }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials:
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Parse distrib name
id: parse-distrib
uses: ./.github/actions/parse-distrib
with:
distrib: ${{ matrix.distrib }}
- run: |
apt update
apt install -y dh-make-perl perl libsmbclient-dev
mv dependencies/perl-filesys-smbclient/src/ perl-filesys-smbclient
tar czf perl-filesys-smbclient.tar.gz perl-filesys-smbclient
DEB_BUILD_OPTIONS="nocheck nodocs notest noautodbgsym" dh-make-perl make --dist ${{ matrix.distrib }} --verbose --build --version 4.0${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} perl-filesys-smbclient/
shell: bash
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.deb
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
deliver-packages:
needs: [get-environment, sign-rpm, package-deb]
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
strategy:
fail-fast: false
matrix:
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
name: deliver ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Delivery
uses: ./.github/actions/package-delivery
with:
module_name: perl-filesys-smbclient
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
release_type: ${{ needs.get-environment.outputs.release_type }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}