diff --git a/.github/actions/deb-delivery-legacy/action.yml b/.github/actions/deb-delivery-legacy/action.yml deleted file mode 100644 index dd70aaab9c..0000000000 --- a/.github/actions/deb-delivery-legacy/action.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: "deb-delivery-legacy" -description: "Deliver legacy DEB packages" -inputs: - module_name: - description: "The package module name" - required: true - distrib: - description: "The distribution used for packaging" - required: true - major_version: - description: "The major version" - required: true - cache_key: - description: "The cached package key" - required: true - stability: - description: "The package stability (stable, testing, unstable)" - required: true - artifactory_token: - description: "token for artifactory" - required: true - -runs: - using: "composite" - steps: - - name: Use cache DEB files - uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - with: - path: ./*.deb - key: ${{ inputs.cache_key }} - fail-on-cache-miss: true - - - uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0 - env: - JF_URL: https://centreon.jfrog.io - JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} - - - name: Publish DEBs to artifactory - run: | - FILES="*.deb" - - for FILE in $FILES; do - echo "[DEBUG] - File: $FILE" - - ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1) - - jf rt upload "$FILE" "apt-standard-${{ inputs.major_version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH" - done - shell: bash diff --git a/.github/actions/deb-delivery/action.yml b/.github/actions/deb-delivery/action.yml deleted file mode 100644 index 0a3fc332aa..0000000000 --- a/.github/actions/deb-delivery/action.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "deb-delivery" -description: "Deliver DEB packages" -inputs: - module_name: - description: "The package module name" - required: true - distrib: - description: "The distribution used for packaging" - required: true - cache_key: - description: "The cached package key" - required: true - stability: - description: "The package stability (stable, testing, unstable)" - required: true - artifactory_token: - description: "token for artifactory" - required: true - -runs: - using: "composite" - steps: - - name: Remove previously delivered DEBs - if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }} - run: rm -f ./*.deb - shell: bash - - - name: Use cache DEB files - if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }} - uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - with: - path: ./*.deb - key: ${{ inputs.cache_key }} - fail-on-cache-miss: true - - - if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }} - uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0 - env: - JF_URL: https://centreon.jfrog.io - JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} - - - name: Publish DEBs to artifactory - if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }} - run: | - FILES="*.deb" - - if [[ "${{ inputs.distrib }}" == "jammy" ]]; then - REPO_PREFIX="ubuntu" - else - REPO_PREFIX="apt" - fi - - for FILE in $FILES; do - echo "[DEBUG] - File: $FILE" - - ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1) - - jf rt upload "$FILE" "${REPO_PREFIX}-plugins-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH" - done - shell: bash diff --git a/.github/actions/package-delivery/action.yml b/.github/actions/package-delivery/action.yml new file mode 100644 index 0000000000..445b00e73c --- /dev/null +++ b/.github/actions/package-delivery/action.yml @@ -0,0 +1,202 @@ +name: "package-delivery" +description: "Deliver packages" +inputs: + module_name: + description: "The package module name" + required: true + distrib: + description: "The distribution used for packaging" + required: true + arch: + description: "The target distribution architecture" + required: false + cache_key: + description: "The cached package key" + required: true + stability: + description: "The package stability (stable, testing, unstable)" + required: true + release_type: + description: "Type of release (hotfix, release)" + required: true + artifactory_token: + description: "token for artifactory" + required: true + +runs: + using: "composite" + steps: + - name: Validate inputs + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + if ('${{ inputs.module_name }}' === '') { + throw new Error('module_name input must be defined'); + } + + if (! ['stable', 'testing', 'unstable'].includes('${{ inputs.stability }}')) { + throw new Error(`Stability ${{ inputs.stability }} should not deliver packages`); + } + + if ('${{ inputs.stability }}' === 'testing' && ! ['testing', 'hotfix'].includes('${{ inputs.release_type }}')) { + throw new Error('release_type input must be defined when stability is testing'); + } + + - name: Parse distrib name + id: parse-distrib + uses: ./.github/actions/parse-distrib + with: + distrib: ${{ inputs.distrib }} + + - name: Get repository stability path + id: get_repository_stability_path + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + let stabilitySubdirectory = '${{ inputs.stability }}'; + + if ('${{ inputs.stability }}' === 'testing' && '${{ inputs.release_type }}' === 'hotfix') { + stabilitySubdirectory = '${{ inputs.stability }}-${{ inputs.release_type }}'; + } + + let repositoryStabilityPath = ''; + if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'el') { + repositoryStabilityPath = `rpm-connectors/2e83f5ff110c44a9cab8f8c7ebbe3c4f/${{ inputs.distrib }}/${stabilitySubdirectory}`; + } else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'ubuntu') { + repositoryStabilityPath = `ubuntu-connectors-${{ inputs.stability }}`; + } else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'debian') { + repositoryStabilityPath = `apt-connectors-${{ inputs.stability }}`; + } else { + throw new Error(`Repository cannot be find for distribution: ${{ inputs.distrib }}`); + } + + core.setOutput( + 'repository_stability_path', + repositoryStabilityPath, + ); + + - if: ${{ inputs.stability != 'stable' }} + name: Restore packages from cache + uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + with: + path: ./*.${{ steps.parse-distrib.outputs.package_extension }} + key: ${{ inputs.cache_key }} + fail-on-cache-miss: true + + - uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1 + with: + disable-job-summary: true + disable-auto-build-publish: true + env: + JF_URL: https://centreon.jfrog.io + JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} + + - if: ${{ inputs.stability == 'testing' }} + name: Clean existing testing packages + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'el') { + await exec.exec( + `jf rt del "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/*/${{ inputs.module_name }}/*.rpm" --exclusions "*/RPMS/*" --quiet` + ); + } else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') { + await exec.exec( + `jf rt del "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --quiet --props "release_type=${{ inputs.release_type }}"` + ); + } + + - name: Download packages from testing + if: ${{ inputs.stability == 'testing' }} + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const warningNoPromote = 'No packages are promoted because push is not related to a hotfix/release pull request.'; + const commitSha = context.sha; + + const { data: { items } } = await github.rest.search.issuesAndPullRequests({ + q: `${commitSha} type:pr is:merged` + }); + + if (items.length === 0) { + core.warning(warningNoPromote); + return; + } + + const prNumber = items[0].number; + + const pr = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber + }); + + const prBaseRef = pr.data?.base?.ref || 'unknown'; + let releaseType = ''; + switch (true) { + case /^release.+/.test(prBaseRef): + releaseType = 'release'; + break; + case /^hotfix.+/.test(prBaseRef): + releaseType = 'hotfix'; + break; + default: + core.warning(warningNoPromote); + return; + } + + let fromStabilitySubdirectory = 'testing'; + if (releaseType === 'hotfix' ) { + fromStabilitySubdirectory = `testing-${releaseType}`; + } + + if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'el') { + await exec.exec( + `jf rt download --flat "rpm-connectors/2e83f5ff110c44a9cab8f8c7ebbe3c4f/${{ inputs.distrib }}/${fromStabilitySubdirectory}/*/${{ inputs.module_name }}/*.rpm"` + ); + } else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'ubuntu') { + await exec.exec( + `jf rt download --flat "ubuntu-connectors-testing/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --props "release_type=${{ inputs.release_type }}"` + ); + } else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'debian') { + await exec.exec( + `jf rt download --flat "apt-connectors-testing/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --props "release_type=${{ inputs.release_type }}"` + ); + } + + - name: Publish packages to ${{ inputs.stability }} + if: | + contains(fromJson('["testing", "unstable"]'), inputs.stability) || + (needs.get-version.outputs.stability == 'stable' && github.event_name == 'push' && inputs.distrib != 'jammy') + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const path = require('path'); + const globber = await glob.create('*.${{ steps.parse-distrib.outputs.package_extension }}'); + + const debTargetProps = '${{ inputs.stability }}' == 'testing' ? '--target-props "release_type=${{ inputs.release_type }}"' : ''; + + for await (const file of globber.globGenerator()) { + const fileName = path.basename(file); + + if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'rpm') { + let arch = 'noarch'; + if (/x86_64/.test(fileName)) { + arch = 'x86_64'; + } + await exec.exec( + `jf rt upload --flat "*.rpm" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/${arch}/${{ inputs.module_name }}/*.rpm"` + ); + } else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') { + let arch = 'all'; + const matches = fileName.match(/_([^_]+)\.deb/); + if (matches !== null && matches.length > 1) { + arch = matches[1]; + } + if ('${{ inputs.arch }}' === '' || '${{ inputs.arch }}' === arch) { + await exec.exec( + `jf rt upload --flat "*.deb" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/${arch}" ${debTargetProps}` + ); + } + } + } diff --git a/.github/actions/package-nfpm/action.yml b/.github/actions/package-nfpm/action.yml index 1aca021b83..189b5fdd9c 100644 --- a/.github/actions/package-nfpm/action.yml +++ b/.github/actions/package-nfpm/action.yml @@ -48,12 +48,6 @@ runs: using: composite steps: - - name: Remove previously packaged DEBs and RPMs - run: | - rm -f ./*.deb - rm -f ./*.rpm - shell: bash - - name: Parse distrib name id: parse-distrib uses: ./.github/actions/parse-distrib @@ -128,14 +122,7 @@ runs: done shell: bash - - if: ${{ inputs.distrib == 'el7' }} - uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: ./*.${{ inputs.package_extension }} - key: ${{ inputs.cache_key }} - - - if: ${{ inputs.distrib != 'el7' }} - uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + - uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: ./*.${{ inputs.package_extension }} key: ${{ inputs.cache_key }} diff --git a/.github/actions/rpm-delivery-legacy/action.yml b/.github/actions/rpm-delivery-legacy/action.yml deleted file mode 100644 index 1f801a510e..0000000000 --- a/.github/actions/rpm-delivery-legacy/action.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: "rpm-delivery-legacy" -description: "rpm delivery in legacy repositories" -inputs: - module_name: - description: "The package module name" - required: true - major_version: - description: "The major version" - required: true - distrib: - description: "The distribution used for packaging" - required: true - cache_key: - description: "The cached package key" - required: true - stability: - description: "The package stability (stable, testing, unstable)" - required: true - artifactory_token: - description: "token for artifactory" - required: true - -runs: - using: "composite" - steps: - - name: Use cache RPM files - uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - with: - path: ./*.rpm - key: ${{ inputs.cache_key }} - fail-on-cache-miss: true - - - uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0 - env: - JF_URL: https://centreon.jfrog.io - JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} - - - name: Publish RPMs to standard repository - run: | - FILES="*.rpm" - - echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" - - if [ -z "${{ inputs.module_name }}" ]; then - echo "::error::Module name is required" - exit 1 - fi - - if [ -z "${{ inputs.distrib }}" ]; then - echo "::error::Distrib is required" - exit 1 - fi - - mkdir noarch x86_64 - - for FILE in $FILES; do - echo "[DEBUG] - File: $FILE" - - ARCH=$(echo $FILE | grep -oP '(x86_64|noarch)') - - echo "[DEBUG] - Arch: $ARCH" - - cp "$FILE" "$ARCH" - done - - for ARCH in "noarch" "x86_64"; do - if [ "$(ls -A $ARCH)" ]; then - if [ "${{ inputs.stability }}" == "stable" ]; then - jf rt upload "$ARCH/*.rpm" "rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" --flat - else - jf rt upload "$ARCH/*.rpm" "rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat - fi - fi - done - shell: bash diff --git a/.github/actions/rpm-delivery/action.yml b/.github/actions/rpm-delivery/action.yml deleted file mode 100644 index b5eef4f1bd..0000000000 --- a/.github/actions/rpm-delivery/action.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "rpm-delivery" -description: "rpm delivery" -inputs: - module_name: - description: "The package module name" - required: true - distrib: - description: "The distribution used for packaging" - required: true - cache_key: - description: "The cached package key" - required: true - stability: - description: "The package stability (stable, testing, unstable)" - required: true - artifactory_token: - description: "token for artifactory" - required: true - -runs: - using: "composite" - steps: - - name: Remove previously delivered RPMs - run: rm -f ./*.rpm - shell: bash - - - name: Use cache RPM files - uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 - with: - path: ./*.rpm - key: ${{ inputs.cache_key }} - fail-on-cache-miss: true - - - uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0 - env: - JF_URL: https://centreon.jfrog.io - JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} - - - name: Publish RPMs to plugins repository - run: | - FILES="*.rpm" - - echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" - - if [ -z "${{ inputs.module_name }}" ]; then - echo "module name is required" - exit 1 - fi - - if [ -z "${{ inputs.distrib }}" ]; then - echo "distrib is required" - exit 1 - fi - - rm -rf noarch x86_64 - mkdir noarch x86_64 - - for FILE in $FILES; do - echo "[DEBUG] - File: $FILE" - - ARCH=$(echo $FILE | grep -oP '(x86_64|noarch)') - - echo "[DEBUG] - Arch: $ARCH" - - cp "$FILE" "$ARCH" - done - - for ARCH in "noarch" "x86_64"; do - if [ "$(ls -A $ARCH)" ]; then - if [ "${{ inputs.stability }}" == "stable" ]; then - jf rt upload "$ARCH/*.rpm" "rpm-plugins/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" --flat - else - jf rt upload "$ARCH/*.rpm" "rpm-plugins/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat - fi - fi - done - shell: bash diff --git a/.github/docker/packaging/Dockerfile.packaging-plugins-alma8 b/.github/docker/packaging/Dockerfile.packaging-plugins-alma8 index c8f2f43e77..e9fe67b494 100644 --- a/.github/docker/packaging/Dockerfile.packaging-plugins-alma8 +++ b/.github/docker/packaging/Dockerfile.packaging-plugins-alma8 @@ -10,7 +10,7 @@ baseurl=https://repo.goreleaser.com/yum/ enabled=1 gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo -dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm openssl-devel jq zstd selinux-policy-devel +dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm-2.41.0 openssl-devel jq zstd selinux-policy-devel dnf -y install perl-App-cpanminus perl-JSON cpanm App::FatPacker cpanm File::Copy::Recursive diff --git a/.github/docker/packaging/Dockerfile.packaging-plugins-alma9 b/.github/docker/packaging/Dockerfile.packaging-plugins-alma9 index bb4edb2293..23bd219eb5 100644 --- a/.github/docker/packaging/Dockerfile.packaging-plugins-alma9 +++ b/.github/docker/packaging/Dockerfile.packaging-plugins-alma9 @@ -10,7 +10,7 @@ baseurl=https://repo.goreleaser.com/yum/ enabled=1 gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo -dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm openssl-devel jq zstd selinux-policy-devel +dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm-2.41.0 openssl-devel jq zstd selinux-policy-devel dnf -y install perl-App-cpanminus perl-JSON cpanm App::FatPacker cpanm File::Copy::Recursive diff --git a/.github/docker/packaging/Dockerfile.packaging-plugins-bookworm b/.github/docker/packaging/Dockerfile.packaging-plugins-bookworm index 5927c55b83..9b7f90b073 100644 --- a/.github/docker/packaging/Dockerfile.packaging-plugins-bookworm +++ b/.github/docker/packaging/Dockerfile.packaging-plugins-bookworm @@ -59,7 +59,7 @@ gem install fpm echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list apt-get update -apt-get install -y nfpm +apt-get install -y nfpm=2.41.0 apt-get clean diff --git a/.github/docker/packaging/Dockerfile.packaging-plugins-bullseye b/.github/docker/packaging/Dockerfile.packaging-plugins-bullseye index 06acc0571b..39881c897f 100644 --- a/.github/docker/packaging/Dockerfile.packaging-plugins-bullseye +++ b/.github/docker/packaging/Dockerfile.packaging-plugins-bullseye @@ -61,7 +61,7 @@ gem install fpm echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list apt-get update -apt-get install -y nfpm +apt-get install -y nfpm=2.41.0 apt-get clean diff --git a/.github/docker/packaging/Dockerfile.packaging-plugins-centos7 b/.github/docker/packaging/Dockerfile.packaging-plugins-centos7 deleted file mode 100644 index 3fd80dd488..0000000000 --- a/.github/docker/packaging/Dockerfile.packaging-plugins-centos7 +++ /dev/null @@ -1,19 +0,0 @@ -ARG REGISTRY_URL=docker.io - -FROM ${REGISTRY_URL}/centos:7 - -RUN bash -e < { + if (headRef === prPath[prPath.length - 1] && ! prPath.includes(baseRef)) { + found = true; + prPath.push(baseRef); + } + }); + } + + return prPath; + + - name: Get stability + id: get_stability + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const getStability = (branchName) => { + switch (true) { + case /(^develop$)|(^dev-\d{2}\.\d{2}\.x$)|(^prepare-release-cloud.*)/.test(branchName): + return 'unstable'; + case /(^release.+)|(^hotfix.+)/.test(branchName): + return 'testing'; + case /(^master$)|(^\d{2}\.\d{2}\.x$)/.test(branchName): + return 'stable'; + default: + return 'canary'; + } + }; + + core.setOutput('stability', getStability('${{ github.head_ref || github.ref_name }}')); + + let isTargetingFeatureBranch = false; + if ("${{ github.event_name }}" === "pull_request") { + let targetStability = 'canary'; + const prPath = ${{ steps.pr_path.outputs.result || '[]' }}; + prPath.shift(); // remove current branch + + if (prPath.length && getStability(prPath[0]) === 'canary') { + isTargetingFeatureBranch = true; + } + + prPath.every((branchName) => { + console.log(`checking stability of ${branchName}`) + targetStability = getStability(branchName); - case "$BRANCHNAME" in - develop) - STABILITY="unstable" - ;; - release* | hotfix*) - STABILITY="testing" - ;; - master) - STABILITY="stable" - ;; - *) - STABILITY="canary" - ;; - esac - - echo "stability=$STABILITY" >> $GITHUB_OUTPUT + if (targetStability !== 'canary') { + return false; + } + return true; + }); + + core.setOutput('target_stability', targetStability); + } + + core.setOutput('is_targeting_feature_branch', isTargetingFeatureBranch); + + - name: Get version + id: get_version + run: | if [[ "${{ inputs.version_file }}" == "" ]]; then VERSION=$(date '+%Y%m%d') elif [[ "${{ inputs.version_file }}" == */*.yaml ]]; then @@ -60,7 +124,62 @@ jobs: VERSION=$(grep VERSION ${{ inputs.version_file }} | cut -d "'" -f 2) fi echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT + shell: bash + - name: "Get release: 1 for testing / stable, . for others" + id: get_release + run: | RELEASE=$(date '+%H%M%S') - echo "release=$(echo $RELEASE)" >> $GITHUB_OUTPUT + + echo "release=$RELEASE" >> $GITHUB_OUTPUT shell: bash + + - name: "Get release type: hotfix, release or not defined if not a release" + id: get_release_type + run: | + RELEASE_TYPE=$(echo "${{ github.head_ref || github.ref_name }}" | cut -d '-' -f 1) + if [[ "$RELEASE_TYPE" == "hotfix" || "$RELEASE_TYPE" == "release" ]]; then + echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT + fi + shell: bash + + - name: Display info in job summary + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const outputTable = [ + [{data: 'Name', header: true}, {data: 'Value', header: true}], + ['version', '${{ steps.get_version.outputs.version }}'], + ['release', '${{ steps.get_release.outputs.release }}'], + ['stability', '${{ steps.get_stability.outputs.stability }}'], + ['release_type', '${{ steps.get_release_type.outputs.release_type || 'not defined because this is not a release' }}'], + ['is_targeting_feature_branch', '${{ steps.get_stability.outputs.is_targeting_feature_branch }}'], + ['target_stability', '${{ steps.get_stability.outputs.target_stability || 'not defined because current run is not triggered by pull request event' }}'], + ]; + core.summary + .addHeading(`${context.workflow} environment outputs`) + .addTable(outputTable); + + if ("${{ github.event_name }}" === "pull_request") { + const prPath = ${{ steps.pr_path.outputs.result || '[]' }}; + const mainBranchName = prPath.pop(); + let codeBlock = ` + %%{ init: { 'gitGraph': { 'mainBranchName': '${mainBranchName}', 'showCommitLabel': false } } }%% + gitGraph + commit`; + prPath.reverse().forEach((branchName) => { + codeBlock = `${codeBlock} + branch ${branchName} + checkout ${branchName} + commit`; + }); + + core.summary + .addHeading('Git workflow') + .addCodeBlock( + codeBlock, + "mermaid" + ); + } + + core.summary.write(); diff --git a/.github/workflows/nrpe.yml b/.github/workflows/nrpe.yml index 4d53620364..88e06dacac 100644 --- a/.github/workflows/nrpe.yml +++ b/.github/workflows/nrpe.yml @@ -24,7 +24,7 @@ jobs: package: needs: [get-environment] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -114,46 +114,40 @@ jobs: rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} stability: ${{ needs.get-environment.outputs.stability }} - deliver-rpm: + deliver-packages: needs: [get-environment, package] - if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - - strategy: - matrix: - distrib: [el8, el9] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: nrpe - distrib: ${{ matrix.distrib }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - - deliver-deb: - needs: [get-environment, package] - if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - + 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: - distrib: [bullseye, bookworm, jammy] - + 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: nrpe distrib: ${{ matrix.distrib }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ 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 }} diff --git a/.github/workflows/perl-cpan-libraries.yml b/.github/workflows/perl-cpan-libraries.yml index 75ab46d1a4..10c35953e8 100644 --- a/.github/workflows/perl-cpan-libraries.yml +++ b/.github/workflows/perl-cpan-libraries.yml @@ -319,28 +319,6 @@ jobs: path: ./*.rpm key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} - deliver-rpm: - needs: [get-environment, sign-rpm] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - - strategy: - matrix: - distrib: [el8, el9] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-cpan-libraries - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} - package-deb: needs: [get-environment] if: ${{ needs.get-environment.outputs.stability != 'stable' }} @@ -545,44 +523,40 @@ jobs: path: ./*.deb key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} - deliver-deb: - needs: [get-environment, download-and-cache-deb] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - + deliver-packages: + needs: [get-environment, sign-rpm, download-and-cache-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: - distrib: [bullseye, bookworm, jammy] + 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: perl-cpan-libraries distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} 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: - distrib: [el8, el9, bullseye, bookworm] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-cpan-libraries - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-crypt-argon2.yml b/.github/workflows/perl-crypt-argon2.yml index bf682d8349..78b6b23abf 100644 --- a/.github/workflows/perl-crypt-argon2.yml +++ b/.github/workflows/perl-crypt-argon2.yml @@ -141,88 +141,49 @@ jobs: path: ./*.${{ matrix.package_extension}} retention-days: 1 - deliver-rpm: + deliver-packages: 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-crypt-argon2-amd64 - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-perl-crypt-argon2-${{ 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] - + 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 + arch: amd64 + - distrib: el9 + package_extension: rpm + arch: amd64 - distrib: bullseye + package_extension: deb arch: amd64 + - distrib: bullseye + package_extension: deb + arch: arm64 - distrib: bookworm + package_extension: deb arch: amd64 - distrib: jammy + package_extension: deb arch: amd64 - - distrib: bullseye - arch: arm64 - - name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }} + name: deliver ${{ matrix.distrib }} ${{ matrix.arch }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: perl-crypt-argon2-${{ matrix.arch }} distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-perl-crypt-argon2-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + arch: ${{ matrix.arch }} + cache_key: cache-${{ github.sha }}-rpm-perl-crypt-argon2-${{ 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: bookworm - arch: amd64 - - distrib: bullseye - arch: arm64 - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-crypt-argon2-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-filesys-smbclient.yml b/.github/workflows/perl-filesys-smbclient.yml index b29617db49..626b663f2b 100644 --- a/.github/workflows/perl-filesys-smbclient.yml +++ b/.github/workflows/perl-filesys-smbclient.yml @@ -153,66 +153,40 @@ jobs: path: ./*.deb key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} - deliver-rpm: - needs: [get-environment, sign-rpm] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - - strategy: - matrix: - distrib: [el8, el9] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-filesys-smbclient - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} - - deliver-deb: - needs: [get-environment, package-deb] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - + 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: - distrib: [bullseye, bookworm, jammy] - + 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: perl-filesys-smbclient distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} 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: - distrib: [el8, el9, bullseye, bookworm] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-filesys-smbclient - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-json-path.yml b/.github/workflows/perl-json-path.yml index cbe8e5d178..a53855a48c 100644 --- a/.github/workflows/perl-json-path.yml +++ b/.github/workflows/perl-json-path.yml @@ -126,70 +126,40 @@ jobs: path: ./*.${{ matrix.package_extension}} retention-days: 1 - deliver-rpm: + deliver-packages: 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-json-path - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-perl-json-path-${{ matrix.distrib }}-${{ 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] - + 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: - distrib: [bullseye, bookworm, jammy] - - name: Deliver ${{ matrix.distrib }} + 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: perl-json-path distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }} + cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-json-path-${{ matrix.distrib }}-${{ 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: - distrib: [el8, el9, bullseye, bookworm] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-json-path - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-keepass-reader.yml b/.github/workflows/perl-keepass-reader.yml index c219f4bdcd..9a5016b795 100644 --- a/.github/workflows/perl-keepass-reader.yml +++ b/.github/workflows/perl-keepass-reader.yml @@ -117,71 +117,40 @@ jobs: rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} stability: ${{ needs.get-environment.outputs.stability }} - - deliver-rpm: + deliver-packages: 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: ${{ env.module_name }} - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.run_id }}-rpm-${{ env.module_name }}-${{ matrix.distrib }} - 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] - + 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: - distrib: [bullseye, bookworm, jammy] - - name: Deliver ${{ matrix.distrib }} + 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: ${{ env.module_name }} distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.run_id }}-deb-${{ env.module_name }}-${{ matrix.distrib }} + cache_key: cache-${{ github.run_id }}-${{ matrix.package_extension }}-${{ env.module_name }}-${{ matrix.distrib }} 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: - distrib: [bullseye, bookworm] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: ${{ env.module_name }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-libssh-session.yml b/.github/workflows/perl-libssh-session.yml index d894f4aac6..d56ac394df 100644 --- a/.github/workflows/perl-libssh-session.yml +++ b/.github/workflows/perl-libssh-session.yml @@ -139,88 +139,49 @@ jobs: path: ./*.${{ matrix.package_extension}} retention-days: 1 - deliver-rpm: + deliver-packages: 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - 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] - + 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 + arch: amd64 + - distrib: el9 + package_extension: rpm + arch: amd64 - distrib: bullseye + package_extension: deb arch: amd64 - distrib: bullseye + package_extension: deb arch: arm64 - distrib: bookworm + package_extension: deb arch: amd64 - distrib: jammy + package_extension: deb arch: amd64 - name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }} - + name: deliver ${{ matrix.distrib }} ${{ matrix.arch }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-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 }} + arch: ${{ matrix.arch }} + cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-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: bookworm - arch: amd64 - - distrib: bullseye - arch: arm64 - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-libssh-session-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-net-curl.yml b/.github/workflows/perl-net-curl.yml index 55d7365b6b..64b85d5e34 100644 --- a/.github/workflows/perl-net-curl.yml +++ b/.github/workflows/perl-net-curl.yml @@ -139,88 +139,49 @@ jobs: path: ./*.${{ matrix.package_extension }} retention-days: 1 - deliver-rpm: + deliver-packages: 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-net-curl-amd64 - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-perl-net-curl-${{ 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] - + 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 + arch: amd64 + - distrib: el9 + package_extension: rpm + arch: amd64 - distrib: bullseye + package_extension: deb arch: amd64 + - distrib: bullseye + package_extension: deb + arch: arm64 - distrib: bookworm + package_extension: deb arch: amd64 - distrib: jammy + package_extension: deb arch: amd64 - - distrib: bullseye - arch: arm64 - - name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }} + name: deliver ${{ matrix.distrib }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: perl-net-curl-${{ matrix.arch }} distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-perl-net-curl-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} + arch: ${{ matrix.arch }} + cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-net-curl-${{ 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: bookworm - arch: amd64 - - distrib: bullseye - arch: arm64 - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-net-curl-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-openwsman.yml b/.github/workflows/perl-openwsman.yml index 2367a2e774..c578ce7681 100644 --- a/.github/workflows/perl-openwsman.yml +++ b/.github/workflows/perl-openwsman.yml @@ -206,132 +206,54 @@ jobs: rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} stability: ${{ needs.get-environment.outputs.stability }} - 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery libwsman - uses: ./.github/actions/rpm-delivery + - uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: - module_name: libwsman-amd64 - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-libwsman-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }} - stability: ${{ needs.get-environment.outputs.stability }} - - - name: Delivery perl-openwsman - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-openwsman-amd64 - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-rpm-perl-openwsman-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }} - stability: ${{ needs.get-environment.outputs.stability }} + path: ./*.${{ matrix.package_extension }} + key: cache-${{ github.sha }}-${{ matrix.package_extension }}-wsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} - deliver-deb: + deliver-packages: 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: bookworm - arch: amd64 - - distrib: jammy - arch: amd64 - - distrib: bullseye - arch: arm64 - - name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }} - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery sblim-sfcc - uses: ./.github/actions/deb-delivery - with: - module_name: sblim-sfcc-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-sblim-sfcc-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} - stability: ${{ needs.get-environment.outputs.stability }} - - - name: Delivery libwsman - uses: ./.github/actions/deb-delivery - with: - module_name: libwsman-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-libwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} - stability: ${{ needs.get-environment.outputs.stability }} - - - name: Delivery perl-openwsman - uses: ./.github/actions/deb-delivery - with: - module_name: perl-openwsman-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: cache-${{ github.sha }}-deb-perl-openwsman-${{ 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] + 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 arch: amd64 - distrib: el9 + package_extension: rpm arch: amd64 - distrib: bullseye - arch: amd64 - - distrib: bookworm + package_extension: deb arch: amd64 - distrib: bullseye + package_extension: deb arch: arm64 + - distrib: bookworm + package_extension: deb + arch: amd64 + - distrib: jammy + package_extension: deb + arch: amd64 + name: deliver ${{ matrix.distrib }} ${{ matrix.arch }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - name: Promote sblim-sfcc ${{ matrix.distrib }} ${{ matrix.arch }} to stable - if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy"]'), matrix.distrib) }} - uses: ./.github/actions/promote-to-stable + - name: Delivery + uses: ./.github/actions/package-delivery with: - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: sblim-sfcc-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} - - - name: Promote libwsman ${{ matrix.distrib }} ${{ matrix.arch }} to stable - uses: ./.github/actions/promote-to-stable - with: - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: libwsman-${{ matrix.arch }} + module_name: wsman-${{ matrix.arch }} distrib: ${{ matrix.distrib }} + arch: ${{ matrix.arch }} + cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-wsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-environment.outputs.stability }} - - - name: Promote perl-openwsman ${{ matrix.distrib }} ${{ matrix.arch }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-openwsman-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/perl-vmware-vsphere.yml b/.github/workflows/perl-vmware-vsphere.yml index 65140448c3..65f83d0e5b 100644 --- a/.github/workflows/perl-vmware-vsphere.yml +++ b/.github/workflows/perl-vmware-vsphere.yml @@ -145,84 +145,49 @@ jobs: rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} stability: ${{ needs.get-environment.outputs.stability }} - deliver-rpm: + deliver-packages: needs: [get-environment, package] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - - strategy: - matrix: - distrib: [el8, el9] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Delivery - uses: ./.github/actions/rpm-delivery - with: - module_name: perl-vmware-vsphere-amd64 - distrib: ${{ matrix.distrib }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}-amd64 - stability: ${{ needs.get-environment.outputs.stability }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - - deliver-deb: - needs: [get-environment, package] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - + 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 + arch: amd64 + - distrib: el9 + package_extension: rpm + arch: amd64 - distrib: bullseye + package_extension: deb arch: amd64 - distrib: bullseye + package_extension: deb arch: arm64 - distrib: bookworm + package_extension: deb arch: amd64 - distrib: jammy + package_extension: deb arch: amd64 + name: deliver ${{ matrix.distrib }} ${{ matrix.arch }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/deb-delivery + uses: ./.github/actions/package-delivery with: module_name: perl-vmware-vsphere-${{ matrix.arch }} distrib: ${{ matrix.distrib }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}-${{ matrix.arch }} + arch: ${{ matrix.arch }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }} stability: ${{ needs.get-environment.outputs.stability }} + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - - 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: bookworm - arch: amd64 - - distrib: bullseye - arch: arm64 - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable - uses: ./.github/actions/promote-to-stable - with: - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: perl-vmware-vsphere-${{ matrix.arch }} - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/plink.yml b/.github/workflows/plink.yml index 4eba681e39..80ad2d9d23 100644 --- a/.github/workflows/plink.yml +++ b/.github/workflows/plink.yml @@ -108,44 +108,34 @@ jobs: path: ./*.rpm retention-days: 1 - deliver-rpm: + deliver-packages: needs: [get-environment, sign-rpm] - if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - + 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: - distrib: [el8, el9] + include: + - distrib: el8 + package_extension: rpm + - distrib: el9 + package_extension: rpm + name: deliver ${{ matrix.distrib }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/rpm-delivery + uses: ./.github/actions/package-delivery with: module_name: plink distrib: ${{ matrix.distrib }} - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} 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: - distrib: [el8, el9] - - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Promote ${{ matrix.distrib }} to stable - uses: ./.github/actions/promote-to-stable - with: + release_type: ${{ needs.get-environment.outputs.release_type }} artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - module: plink - distrib: ${{ matrix.distrib }} - stability: ${{ needs.get-environment.outputs.stability }} diff --git a/.github/workflows/plugin-delivery.yml b/.github/workflows/plugin-delivery.yml deleted file mode 100644 index 9f80aaaf4f..0000000000 --- a/.github/workflows/plugin-delivery.yml +++ /dev/null @@ -1,160 +0,0 @@ -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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.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 diff --git a/.github/workflows/plugins-selinux.yml b/.github/workflows/plugins-selinux.yml index 130e23ec72..355958558c 100644 --- a/.github/workflows/plugins-selinux.yml +++ b/.github/workflows/plugins-selinux.yml @@ -69,24 +69,34 @@ jobs: rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} stability: ${{ needs.get-environment.outputs.stability }} - deliver-rpm: + deliver-packages: needs: [get-environment, package] - if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} - runs-on: [self-hosted, common] - + 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: - distrib: [el8, el9] + include: + - distrib: el8 + package_extension: rpm + - distrib: el9 + package_extension: rpm + name: deliver ${{ matrix.distrib }} steps: - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Delivery - uses: ./.github/actions/rpm-delivery + uses: ./.github/actions/package-delivery with: module_name: plugins-selinux distrib: ${{ matrix.distrib }} - cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ 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 }} diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index e765a4722e..0af936c663 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -158,13 +158,13 @@ jobs: COMMIT=$(git log -1 HEAD --pretty=format:%h) perl .github/scripts/plugins-source.container.pl "${{ needs.get-plugins.outputs.plugins }}" "${{ needs.get-environment.outputs.version }} ($COMMIT)" - - uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ./build/ key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} package: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: [get-environment, get-plugins, fatpacker] strategy: @@ -200,24 +200,9 @@ jobs: steps: - name: Checkout sources - if: ${{ matrix.distrib == 'el7' }} - # el7 is not compatible with checkout v4 which uses node20 - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - - - name: Checkout sources - if: ${{ matrix.distrib != 'el7' }} uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - if: ${{ matrix.distrib == 'el7' }} - # el7 is not compatible with checkout v4 which uses node20 - uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: ./build/ - key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} - fail-on-cache-miss: true - - - if: ${{ matrix.distrib != 'el7' }} - uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ./build/ key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }} @@ -304,7 +289,7 @@ jobs: matrix: image: [testing-plugins-alma8, testing-plugins-alma9, testing-plugins-jammy, testing-plugins-bullseye, testing-plugins-bookworm] include: - - runner_name: ubuntu-22.04 + - runner_name: ubuntu-24.04 - package_extension: rpm image: testing-plugins-alma8 distrib: el8 @@ -350,14 +335,94 @@ jobs: path: /var/log/robot-plugins-installation-tests.log retention-days: 1 - deliver: - needs: [get-environment, package, test-plugins] - if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} - uses: ./.github/workflows/plugin-delivery.yml - with: - version: ${{ needs.get-environment.outputs.version }} - release: ${{ needs.get-environment.outputs.release }} - stability: ${{ needs.get-environment.outputs.stability }} - secrets: - artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} - token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }} + deliver-packages: + needs: [get-environment, get-plugins, test-plugins] + if: | + needs.get-plugins.outputs.plugins != '' && + (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: el7 + package_extension: rpm + - 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: plugins + 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 }} + + deliver-sources: + needs: [get-environment] + if: ${{ needs.get-environment.outputs.stability == 'stable' && github.event_name == 'push' }} + runs-on: [self-hosted, common] + + steps: + - name: Checkout sources + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + + - uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.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: ${{ needs.get-environment.outputs.version }} + release: ${{ needs.get-environment.outputs.release }} + token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }} + + release-tag: + needs: [get-environment] + if: ${{ needs.get-environment.outputs.stability == 'stable' && github.event_name == 'push' }} + runs-on: ubuntu-24.04 + + steps: + - name: Checkout sources + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + + - 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