centreon-plugins/.github/workflows/plugin-delivery.yml

161 lines
5.1 KiB
YAML

on:
workflow_call:
inputs:
version:
description: The package version
type: string
required: true
release:
description: The package release
type: string
required: true
stability:
description: The package stability (stable, testing, unstable)
type: string
required: true
secrets:
artifactory_token:
description: "The artifactory token"
required: true
token_download_centreon_com:
description: "The token to call download.centreon.com api"
required: true
jobs:
deliver-sources:
runs-on: [self-hosted, common]
if: ${{ contains(fromJson('["stable"]'), inputs.stability) && github.event_name != 'workflow_dispatch' }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ./build/
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
fail-on-cache-miss: true
- name: Deliver sources
uses: ./.github/actions/release-sources
with:
bucket_directory: centreon-plugins
module_directory: build
module_name: centreon-plugins
version: ${{ inputs.version }}
release: ${{ inputs.release }}
token_download_centreon_com: ${{ secrets.token_download_centreon_com }}
deliver-rpm:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [el7, el8, el9]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/rpm-delivery
with:
module_name: plugins
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
deliver-rpm-legacy:
if: ${{ inputs.stability == 'stable' && github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [el7, el8]
major_version: ["21.10", "22.04", "22.10"]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/rpm-delivery-legacy
with:
module_name: plugins
major_version: ${{ matrix.major_version }}
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
deliver-deb:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/deb-delivery
with:
module_name: plugins
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
deliver-deb-legacy:
if: ${{ inputs.stability == 'stable' && github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [bullseye]
major_version: ["22.04", "22.10"]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/deb-delivery-legacy
with:
module_name: plugins
distrib: ${{ matrix.distrib }}
major_version: ${{ matrix.major_version }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
release-tag:
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Push git release tag
run: |
RELEASE=plugins-$(date '+%Y%m%d')
EXISTING_TAG=$(git tag --list "$RELEASE" | head -n 1)
git config --global user.email "release@centreon.com"
git config --global user.name "Centreon"
if [ -z "$EXISTING_TAG" ]; then
git tag -a "$RELEASE" -m "release $RELEASE"
git push --follow-tags
else
echo "::warning::Release tag $RELEASE already exists"
fi
shell: bash