204 lines
6.6 KiB
YAML
204 lines
6.6 KiB
YAML
name: perl-libssh-session
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- "dependencies/perl-libssh-session/**"
|
|
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-libssh-session/**"
|
|
|
|
jobs:
|
|
get-environment:
|
|
uses: ./.github/workflows/get-environment.yml
|
|
|
|
package:
|
|
needs: [get-environment]
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- image: packaging-plugins-alma8
|
|
distrib: el8
|
|
package_extension: rpm
|
|
runner: ubuntu-22.04
|
|
arch: amd64
|
|
- image: packaging-plugins-alma9
|
|
distrib: el9
|
|
package_extension: rpm
|
|
runner: ubuntu-22.04
|
|
arch: amd64
|
|
- image: packaging-plugins-bullseye
|
|
distrib: bullseye
|
|
package_extension: deb
|
|
runner: ubuntu-22.04
|
|
arch: amd64
|
|
- image: packaging-plugins-bullseye-arm64
|
|
distrib: bullseye
|
|
package_extension: deb
|
|
runner: ["self-hosted", "collect-arm64"]
|
|
arch: arm64
|
|
|
|
runs-on: ${{ matrix.runner }}
|
|
|
|
container:
|
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
|
credentials:
|
|
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
|
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
|
|
|
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
|
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install locally Libssh::Session
|
|
run: |
|
|
if [ "${{ matrix.distrib }}" = "bullseye" ]; then
|
|
apt-get update
|
|
apt-get install -y cpanminus gcc libssh-dev
|
|
else
|
|
dnf install -y cpanminus gcc libssh-devel
|
|
fi
|
|
|
|
cpanm -v -l /tmp Libssh::Session@0.8
|
|
shell: bash
|
|
|
|
- name: Set package name and paths according to distrib
|
|
run: |
|
|
if [ "${{ matrix.distrib }}" = "bullseye" ]; then
|
|
NAME="libssh-session-perl"
|
|
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
|
PERL_VENDORARCH="/usr/lib/x86_64-linux-gnu/perl5/5.32"
|
|
else
|
|
PERL_VENDORARCH="/usr/lib/aarch64-linux-gnu/perl5/5.32"
|
|
fi
|
|
else
|
|
NAME="perl-Libssh-Session"
|
|
if [ "${{ matrix.distrib }}" = "el8" ]; then
|
|
PERL_VENDORARCH="/usr/local/lib64/perl5"
|
|
else
|
|
PERL_VENDORARCH="/usr/local/lib64/perl5/5.32"
|
|
fi
|
|
fi
|
|
|
|
sed -i "s/@NAME@/$NAME/g" dependencies/perl-libssh-session/perl-libssh-session.yaml
|
|
sed -i "s#@PERL_VENDORARCH@#$PERL_VENDORARCH#g" dependencies/perl-libssh-session/perl-libssh-session.yaml
|
|
|
|
cat dependencies/perl-libssh-session/perl-libssh-session.yaml
|
|
shell: bash
|
|
|
|
- name: Package
|
|
uses: ./.github/actions/package-nfpm
|
|
with:
|
|
nfpm_file_pattern: "dependencies/perl-libssh-session/perl-libssh-session.yaml"
|
|
distrib: ${{ matrix.distrib }}
|
|
package_extension: ${{ matrix.package_extension }}
|
|
arch: ${{ matrix.arch }}
|
|
commit_hash: ${{ github.sha }}
|
|
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-libssh-session-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
|
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 }}
|
|
|
|
# set condition to true if artifacts are needed
|
|
- if: ${{ false }}
|
|
name: Upload package artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
|
path: ./*.${{ matrix.package_extension}}
|
|
retention-days: 1
|
|
|
|
deliver-rpm:
|
|
needs: [get-environment, package]
|
|
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
|
runs-on: [self-hosted, common]
|
|
|
|
strategy:
|
|
matrix:
|
|
distrib: [el8, el9]
|
|
|
|
name: Deliver ${{ matrix.distrib }}
|
|
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Delivery
|
|
uses: ./.github/actions/rpm-delivery
|
|
with:
|
|
module_name: perl-libssh-session-amd64
|
|
distrib: ${{ matrix.distrib }}
|
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
|
cache_key: cache-${{ github.sha }}-rpm-perl-libssh-session-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
|
|
stability: ${{ needs.get-environment.outputs.stability }}
|
|
|
|
deliver-deb:
|
|
needs: [get-environment, package]
|
|
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
|
runs-on: [self-hosted, common]
|
|
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- distrib: bullseye
|
|
arch: amd64
|
|
- distrib: bullseye
|
|
arch: arm64
|
|
|
|
name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
|
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Delivery
|
|
uses: ./.github/actions/deb-delivery
|
|
with:
|
|
module_name: perl-libssh-session-${{ matrix.arch }}
|
|
distrib: ${{ matrix.distrib }}
|
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
|
cache_key: cache-${{ github.sha }}-deb-perl-libssh-session-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
|
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:
|
|
include:
|
|
- distrib: el8
|
|
arch: amd64
|
|
- distrib: el9
|
|
arch: amd64
|
|
- distrib: bullseye
|
|
arch: amd64
|
|
- distrib: bullseye
|
|
arch: arm64
|
|
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
|
uses: ./.github/actions/promote-to-stable
|
|
with:
|
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
|
module: perl-libssh-session-${{ matrix.arch }}
|
|
distrib: ${{ matrix.distrib }}
|
|
stability: ${{ needs.get-environment.outputs.stability }}
|