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: nexus_username: required: true nexus_password: required: true update_repo_path: description: "The update repo script path" required: true cloudfront_id: description: "The cloudfront ID for repo url" required: true yum_repo_address: description: "The legacy yum repo address" required: true yum_repo_key: description: "The repo key" required: true 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) }} steps: - name: Checkout sources uses: actions/checkout@v3 - uses: actions/cache/restore@v3 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: runs-on: [self-hosted, common] strategy: fail-fast: false matrix: distrib: [el7, el8, el9] steps: - name: Checkout sources uses: actions/checkout@v3 - 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' }} 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@v3 - 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 }} update_repo_path: ${{ secrets.update_repo_path }} cloudfront_id: ${{ secrets.cloudfront_id }} yum_repo_address: ${{ secrets.yum_repo_address }} yum_repo_key: ${{ secrets.yum_repo_key }} stability: ${{ inputs.stability }} deliver-deb: runs-on: [self-hosted, common] strategy: fail-fast: false matrix: distrib: [bullseye] steps: - name: Checkout sources uses: actions/checkout@v3 - name: Delivery uses: ./.github/actions/deb-delivery with: 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' }} 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@v3 - name: Delivery uses: ./.github/actions/deb-delivery-legacy with: distrib: ${{ matrix.distrib }} major_version: ${{ matrix.major_version }} nexus_username: ${{ secrets.nexus_username }} nexus_password: ${{ secrets.nexus_password }} cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} stability: ${{ inputs.stability }} release-tag: if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }} runs-on: ubuntu-22.04 steps: - name: Checkout sources uses: actions/checkout@v3 - 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