2023-12-07 09:45:34 +01:00
|
|
|
name: plink
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "dependencies/plink/**"
|
|
|
|
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/plink.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:
|
|
|
|
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:
|
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
|
|
|
|
|
|
|
steps:
|
2023-12-20 12:23:48 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 09:45:34 +01:00
|
|
|
|
|
|
|
- run: |
|
|
|
|
yum install -y wget gcc make
|
|
|
|
|
|
|
|
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
|
|
|
|
|
|
|
wget -P ~/rpmbuild/SOURCES/ https://the.earth.li/~sgtatham/putty/0.74/putty-0.74.tar.gz
|
|
|
|
|
|
|
|
rpmbuild -ba dependencies/plink/packaging/rpm/plink.spec
|
|
|
|
|
|
|
|
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
|
|
|
shell: bash
|
|
|
|
|
2024-05-20 18:01:50 +02:00
|
|
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
2023-12-07 09:45:34 +01:00
|
|
|
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:
|
2024-10-03 13:17:13 +02:00
|
|
|
image: docker.centreon.com/centreon-private/rpm-signing:latest
|
2023-12-07 09:45:34 +01:00
|
|
|
options: -t
|
|
|
|
credentials:
|
2024-10-03 13:17:13 +02:00
|
|
|
username: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_USERNAME }}
|
|
|
|
password: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_TOKEN }}
|
2023-12-07 09:45:34 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y zstd
|
|
|
|
shell: bash
|
|
|
|
|
2023-12-20 12:23:48 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-12-07 09:45:34 +01:00
|
|
|
|
2024-05-20 18:01:50 +02:00
|
|
|
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
2023-12-07 09:45:34 +01:00
|
|
|
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
|
|
|
|
|
2024-05-20 18:01:50 +02:00
|
|
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
2023-12-07 09:45:34 +01:00
|
|
|
with:
|
|
|
|
path: ./*.rpm
|
|
|
|
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
|
|
|
|
2024-10-16 11:50:07 +02:00
|
|
|
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2023-12-07 09:45:34 +01:00
|
|
|
with:
|
|
|
|
name: packages-${{ matrix.distrib }}
|
|
|
|
path: ./*.rpm
|
|
|
|
retention-days: 1
|
|
|
|
|
2024-11-14 13:38:52 +01:00
|
|
|
deliver-packages:
|
2023-12-07 09:45:34 +01:00
|
|
|
needs: [get-environment, sign-rpm]
|
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
|
2023-12-07 09:45:34 +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:
|
|
|
|
module_name: plink
|
|
|
|
distrib: ${{ matrix.distrib }}
|
2024-11-14 13:38:52 +01:00
|
|
|
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ 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 }}
|