From cca6bd3ad49a54aa4cb1b7c98a18920c5ee6ecbe Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Tue, 23 Jul 2024 13:43:04 +0200 Subject: [PATCH 1/2] chore(ci): package lua-curl (#1557) --- .github/actions/deb-delivery/action.yml | 80 ++++++ .github/actions/package/action.yml | 4 +- .github/actions/promote-to-stable/action.yml | 5 - .github/actions/rpm-delivery/action.yml | 132 ++++++++++ .github/scripts/collect-prepare-test-robot.sh | 2 + .github/workflows/centreon-collect.yml | 1 - .github/workflows/get-version.yml | 2 +- .github/workflows/gorgone.yml | 1 - .github/workflows/libzmq.yml | 1 - .github/workflows/lua-curl.yml | 227 ++++++++++++++++++ .github/workflows/robot-test.yml | 4 +- lua-curl/packaging/lua-curl.yaml | 53 ++++ 12 files changed, 499 insertions(+), 13 deletions(-) create mode 100644 .github/actions/deb-delivery/action.yml create mode 100644 .github/actions/rpm-delivery/action.yml create mode 100644 .github/workflows/lua-curl.yml create mode 100644 lua-curl/packaging/lua-curl.yaml diff --git a/.github/actions/deb-delivery/action.yml b/.github/actions/deb-delivery/action.yml new file mode 100644 index 00000000000..46b6c5ec189 --- /dev/null +++ b/.github/actions/deb-delivery/action.yml @@ -0,0 +1,80 @@ +name: "deb-delivery" +description: "Package deb packages" +inputs: + module_name: + description: "The package module name" + required: true + distrib: + description: "The distribution used for packaging" + required: true + version: + description: "Centreon packaged 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: "Artifactory token" + required: true + release_type: + description: "Type of release (hotfix, release)" + required: true + release_cloud: + description: "Release context (cloud or not cloud)" + required: true + +runs: + using: "composite" + steps: + - name: Use cache DEB files + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: ./*.deb + key: ${{ inputs.cache_key }} + fail-on-cache-miss: true + + - uses: jfrog/setup-jfrog-cli@0f30b43d62ccad81fba40748d2c671c4665b2d27 # v3.5.3 + env: + JF_URL: https://centreon.jfrog.io + JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} + + - name: Publish DEBs + run: | + FILES="*.deb" + + # DEBUG + echo "[DEBUG] - Version: ${{ inputs.version }}" + echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" + echo "[DEBUG] - module_name: ${{ inputs.module_name }}" + echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}" + echo "[DEBUG] - release_type: ${{ inputs.release_type }}" + echo "[DEBUG] - stability: ${{ inputs.stability }}" + + # Make sure all required inputs are NOT empty + if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then + echo "Some mandatory inputs are empty, please check the logs." + exit 1 + fi + + # Handle either standard debian or ubuntu repository path + if [[ "${{ inputs.distrib }}" == "jammy" ]]; then + ROOT_REPO_PATH="ubuntu-standard-${{ inputs.version }}-${{ inputs.stability }}" + else + ROOT_REPO_PATH="apt-standard-${{ inputs.version }}-${{ inputs.stability }}" + fi + + for FILE in $FILES; do + echo "[DEBUG] - File: $FILE" + + VERSION=${{ inputs.version }} + DISTRIB=$(echo $FILE | cut -d '_' -f2 | cut -d '-' -f2) + ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1) + + echo "[DEBUG] - Version: $VERSION" + + jf rt upload "$FILE" "$ROOT_REPO_PATH/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH" --flat + done + shell: bash diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index b83f9eff217..950b9cb8e27 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -112,8 +112,8 @@ runs: # Update if condition to true to get packages as artifacts - if: ${{ false }} name: Upload package artifacts - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: - name: packages-${{ inputs.distrib }} + name: ${{ inputs.arch != '' && format('packages-{0}-{1}', inputs.distrib, inputs.arch) || format('packages-{0}', inputs.distrib) }} path: ./*.${{ inputs.package_extension}} retention-days: 1 diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml index df267f5acfc..4432aee5663 100644 --- a/.github/actions/promote-to-stable/action.yml +++ b/.github/actions/promote-to-stable/action.yml @@ -13,9 +13,6 @@ inputs: major_version: description: "Centreon packaged major version" required: true - minor_version: - description: "Centreon package minor version" - required: true stability: description: "The package stability (stable, testing, unstable)" required: true @@ -44,7 +41,6 @@ runs: # DEBUG echo "[DEBUG] - Major version: ${{ inputs.major_version }}" - echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}" echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}" echo "[DEBUG] - release_type: ${{ inputs.release_type }}" @@ -113,7 +109,6 @@ runs: set -eux echo "[DEBUG] - Major version: ${{ inputs.major_version }}" - echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}" echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" # Define ROOT_REPO_PATH for debian diff --git a/.github/actions/rpm-delivery/action.yml b/.github/actions/rpm-delivery/action.yml new file mode 100644 index 00000000000..3174c753300 --- /dev/null +++ b/.github/actions/rpm-delivery/action.yml @@ -0,0 +1,132 @@ +name: "rpm-delivery" +description: "Deliver rpm packages" +inputs: + module_name: + description: "The package module name" + required: true + distrib: + description: "The distribution used for packaging" + required: true + version: + description: "Centreon packaged 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: "Artifactory token" + required: true + release_type: + description: "Type of release (hotfix, release)" + required: true + release_cloud: + description: "Release context (cloud or not cloud)" + required: true + +runs: + using: "composite" + steps: + - name: Use cache RPM files + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + 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 + run: | + set -eux + + FILES="*.rpm" + + 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 + + # DEBUG + echo "[DEBUG] - Version: ${{ inputs.version }}" + echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" + echo "[DEBUG] - module_name: ${{ inputs.module_name }}" + echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}" + echo "[DEBUG] - release_type: ${{ inputs.release_type }}" + echo "[DEBUG] - stability: ${{ inputs.stability }}" + + # Make sure all required inputs are NOT empty + if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then + echo "Some mandatory inputs are empty, please check the logs." + exit 1 + fi + + # Create ARCH dirs + mkdir noarch x86_64 + + # Get ARCH target for files to deliver and regroupe them by ARCH + for FILE in $FILES; do + echo "[DEBUG] - File: $FILE" + + ARCH=$(echo $FILE | grep -oP '(x86_64|noarch)') + + echo "[DEBUG] - Arch: $ARCH" + + mv "$FILE" "$ARCH" + done + + # Build upload target path based on release_cloud and release_type values + # if cloud + hotfix or cloud + release, deliver to internal testing- + # if cloud + develop, delivery to internal unstable + # if non-cloud, delivery to onprem testing or unstable + + # CLOUD + HOTFIX + REPO STANDARD INTERNAL OR CLOUD + RELEASE + REPO STANDARD INTERNAL + if [[ ${{ inputs.release_cloud }} -eq 1 ]] && ([[ ${{ inputs.release_type }} == "hotfix" ]] || [[ ${{ inputs.release_type }} == "release" ]]); then + echo "[DEBUG] : Release cloud + ${{ inputs.release_type }}, using rpm-standard-internal." + ROOT_REPO_PATHS="rpm-standard-internal" + UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}/" + + # CLOUD + NOT HOTFIX OR CLOUD + NOT RELEASE + REPO STANDARD INTERNAL + elif [[ ${{ inputs.release_cloud }} -eq 1 ]] && ([[ ${{ inputs.release_type }} != "hotfix" ]] || [[ ${{ inputs.release_type }} != "release" ]]); then + echo "[DEBUG] : Release cloud + NOT ${{ inputs.release_type }}, using rpm-standard-internal." + ROOT_REPO_PATHS="rpm-standard-internal" + UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}/" + + # NON-CLOUD + (HOTFIX OR RELEASE) + REPO STANDARD + elif [[ ${{ inputs.release_cloud }} -eq 0 ]]; then + echo "[DEBUG] : NOT Release cloud + ${{ inputs.release_type }}, using rpm-standard." + ROOT_REPO_PATHS="rpm-standard" + UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" + + # ANYTHING ELSE + else + echo "::error:: Invalid combination of release_type [${{ inputs.release_type }}] and release_cloud [${{ inputs.release_cloud }}]" + exit 1 + fi + + # Deliver based on inputs + for ROOT_REPO_PATH in "$ROOT_REPO_PATHS"; do + for ARCH in "noarch" "x86_64"; do + if [ "$(ls -A $ARCH)" ]; then + if [ "${{ inputs.stability }}" == "stable" ]; then + echo "[DEBUG] - Stability is ${{ inputs.stability }}, not delivering." + elif [ "${{ inputs.stability }}" == "testing" ]; then + jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/$UPLOAD_REPO_PATH" --sync-deletes="$ROOT_REPO_PATH/$UPLOAD_REPO_PATH" --flat + else + jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --sync-deletes="$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat + fi + fi + done + done + + shell: bash diff --git a/.github/scripts/collect-prepare-test-robot.sh b/.github/scripts/collect-prepare-test-robot.sh index 25e9f02e5b0..c3cbc047175 100755 --- a/.github/scripts/collect-prepare-test-robot.sh +++ b/.github/scripts/collect-prepare-test-robot.sh @@ -67,8 +67,10 @@ fi if [ "$distrib" = "ALMALINUX" ]; then dnf groupinstall -y "Development Tools" dnf install -y python3-devel + dnf clean all else apt-get update apt-get install -y build-essential apt-get install -y python3-dev + apt-get clean fi diff --git a/.github/workflows/centreon-collect.yml b/.github/workflows/centreon-collect.yml index 72bc39b648c..557c4b483d1 100644 --- a/.github/workflows/centreon-collect.yml +++ b/.github/workflows/centreon-collect.yml @@ -209,7 +209,6 @@ jobs: module_name: collect distrib: ${{ matrix.distrib }} major_version: ${{ needs.get-version.outputs.major_version }} - minor_version: ${{ needs.get-version.outputs.minor_version }} stability: ${{ needs.get-version.outputs.stability }} github_ref_name: ${{ github.ref_name }} release_type: ${{ needs.get-version.outputs.release_type }} diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 43fe25d2fe7..01ce4667f6e 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -39,7 +39,7 @@ on: jobs: get-version: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: major_version: ${{ steps.get_version.outputs.major_version }} minor_version: ${{ steps.get_version.outputs.minor_version }} diff --git a/.github/workflows/gorgone.yml b/.github/workflows/gorgone.yml index 8e3024097e1..cc1a035fc6c 100644 --- a/.github/workflows/gorgone.yml +++ b/.github/workflows/gorgone.yml @@ -221,7 +221,6 @@ jobs: module_name: gorgone distrib: ${{ matrix.distrib }} major_version: ${{ needs.get-version.outputs.major_version }} - minor_version: ${{ needs.get-version.outputs.minor_version }} stability: ${{ needs.get-version.outputs.stability }} github_ref_name: ${{ github.ref_name }} release_type: ${{ needs.get-version.outputs.release_type }} diff --git a/.github/workflows/libzmq.yml b/.github/workflows/libzmq.yml index d1c2778e6a2..ad0adeb625a 100644 --- a/.github/workflows/libzmq.yml +++ b/.github/workflows/libzmq.yml @@ -221,7 +221,6 @@ jobs: module_name: libzmq distrib: ${{ matrix.distrib }} major_version: ${{ needs.get-version.outputs.major_version }} - minor_version: ${{ needs.get-version.outputs.minor_version }} stability: ${{ needs.get-version.outputs.stability }} github_ref_name: ${{ github.ref_name }} release_type: ${{ needs.get-version.outputs.release_type }} diff --git a/.github/workflows/lua-curl.yml b/.github/workflows/lua-curl.yml new file mode 100644 index 00000000000..96815e14c36 --- /dev/null +++ b/.github/workflows/lua-curl.yml @@ -0,0 +1,227 @@ +name: lua-curl + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + paths: + - lua-curl/** + push: + branches: + - develop + - dev-[2-9][0-9].[0-9][0-9].x + - master + - "[2-9][0-9].[0-9][0-9].x" + paths: + - lua-curl/** + +env: + major_version: 0.3 + minor_version: 13 + release: 20 # 10 for openssl 1.1.1 / 20 for openssl system + +jobs: + get-version: + uses: ./.github/workflows/get-version.yml + + package: + needs: [get-version] + if: ${{ needs.get-version.outputs.stability != 'stable' }} + + strategy: + fail-fast: false + matrix: + include: + - package_extension: rpm + image: centreon-collect-alma8 + distrib: el8 + lua_version: 5.3 + runner: ubuntu-24.04 + arch: amd64 + - package_extension: rpm + image: centreon-collect-alma9 + distrib: el9 + lua_version: 5.4 + runner: ubuntu-24.04 + arch: amd64 + - package_extension: deb + image: centreon-collect-debian-bullseye + distrib: bullseye + lua_version: 5.3 + runner: ubuntu-24.04 + arch: amd64 + - package_extension: deb + image: centreon-collect-debian-bookworm + distrib: bookworm + lua_version: 5.3 + runner: ubuntu-24.04 + arch: amd64 + - package_extension: deb + image: centreon-collect-ubuntu-jammy + distrib: jammy + lua_version: 5.3 + runner: ubuntu-24.04 + arch: amd64 + - package_extension: deb + image: centreon-collect-debian-bullseye-arm64 + distrib: bullseye + lua_version: 5.3 + runner: ["self-hosted", "collect-arm64"] + arch: arm64 + - package_extension: deb + image: centreon-collect-debian-bookworm-arm64 + distrib: bookworm + lua_version: 5.3 + runner: ["self-hosted", "collect-arm64"] + arch: arm64 + + runs-on: ${{ matrix.runner }} + + container: + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ needs.get-version.outputs.img_version }} + credentials: + username: ${{ secrets.DOCKER_REGISTRY_ID }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} + + name: package ${{ matrix.distrib }} ${{ matrix.arch }} + + steps: + - name: Checkout sources + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Checkout sources of lua-curl + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + repository: Lua-cURL/Lua-cURLv3 + path: lua-curl-src + ref: v${{ env.major_version }}.${{ env.minor_version }} + + - name: Compile lua-curl and prepare packaging + run: | + if [ "${{ matrix.package_extension }}" == "rpm" ]; then + dnf install -y dnf-plugins-core + if [ "${{ matrix.distrib }}" == "el8" ]; then + dnf config-manager --set-enabled powertools + else + dnf config-manager --set-enabled crb + fi + dnf install -y make gcc openssl openssl-devel libcurl-devel lua lua-devel + cd lua-curl-src + make + cd .. + else + apt-get update + apt-get install -y make openssl libssl-dev libcurl4-openssl-dev lua${{ matrix.lua_version }} liblua${{ matrix.lua_version }} liblua${{ matrix.lua_version }}-dev + cd lua-curl-src + make LUA_IMPL=lua${{ matrix.lua_version }} LUA_INC=/usr/include/lua${{ matrix.lua_version }} + cd .. + fi + + sed -i "s/@luaver@/${{ matrix.lua_version }}/g" lua-curl/packaging/lua-curl.yaml + shell: bash + + - name: Package + uses: ./.github/actions/package + with: + nfpm_file_pattern: "lua-curl/packaging/lua-curl.yaml" + distrib: ${{ matrix.distrib }} + package_extension: ${{ matrix.package_extension }} + major_version: ${{ env.major_version }} + minor_version: ${{ env.minor_version }} + release: ${{ env.release }} + arch: ${{ matrix.arch }} + commit_hash: ${{ github.sha }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-lua-curl-${{ matrix.distrib }}-${{ matrix.arch }} + 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 }} + stability: ${{ needs.get-version.outputs.stability }} + + deliver-rpm: + if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }} + needs: [get-version, package] + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - distrib: el8 + arch: amd64 + - distrib: el9 + arch: amd64 + name: deliver ${{ matrix.distrib }} ${{ matrix.arch }} + + steps: + - name: Checkout sources + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Publish RPM packages + uses: ./.github/actions/rpm-delivery + with: + module_name: lua-curl + distrib: ${{ matrix.distrib }} + version: ${{ needs.get-version.outputs.major_version }} + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-lua-curl-${{ matrix.distrib }}-${{ matrix.arch }} + stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} + + deliver-deb: + if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }} + needs: [get-version, package] + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - distrib: bullseye + arch: amd64 + - distrib: bullseye + arch: arm64 + - distrib: bookworm + arch: amd64 + - distrib: jammy + arch: amd64 + name: deliver ${{ matrix.distrib }} ${{ matrix.arch }} + + steps: + - name: Checkout sources + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Publish DEB packages + uses: ./.github/actions/deb-delivery + with: + module_name: lua-curl + distrib: ${{ matrix.distrib }} + version: ${{ needs.get-version.outputs.major_version }} + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-lua-curl-${{ matrix.distrib }}-${{ matrix.arch }} + stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} + + promote: + needs: [get-version] + if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }} + 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: + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} + module_name: lua-curl + distrib: ${{ matrix.distrib }} + major_version: ${{ needs.get-version.outputs.major_version }} + stability: ${{ needs.get-version.outputs.stability }} + github_ref_name: ${{ github.ref_name }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} diff --git a/.github/workflows/robot-test.yml b/.github/workflows/robot-test.yml index 5f82f2834e2..d0a0398efb5 100644 --- a/.github/workflows/robot-test.yml +++ b/.github/workflows/robot-test.yml @@ -116,14 +116,14 @@ jobs: fetch-depth: 0 - name: Restore image - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: /tmp/${{inputs.image}} key: ${{inputs.image_test}} fail-on-cache-miss: true - name: Restore packages - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: ${{ inputs.package_cache_path }} key: ${{ inputs.package_cache_key }} diff --git a/lua-curl/packaging/lua-curl.yaml b/lua-curl/packaging/lua-curl.yaml new file mode 100644 index 00000000000..6f3916f8479 --- /dev/null +++ b/lua-curl/packaging/lua-curl.yaml @@ -0,0 +1,53 @@ +name: "lua-curl" +arch: "${ARCH}" +platform: "linux" +version_schema: "none" +version: "${VERSION}" +release: "${RELEASE}${DIST}" +section: "default" +priority: "optional" +maintainer: "Centreon " +description: | + lua curl library + Commit: @COMMIT_HASH@ +vendor: "Centreon" +homepage: "https://www.centreon.com" +license: "Apache-2.0" + +contents: + - src: "../../lua-curl-src/lcurl.so" + dst: "/usr/lib64/lua/@luaver@/lcurl.so" + file_info: + mode: 0644 + packager: rpm + - src: "../../lua-curl-src/lcurl.so" + dst: "/usr/lib/x86_64-linux-gnu/lua/@luaver@/lcurl.so" + file_info: + mode: 0644 + packager: deb + + - src: "../../lua-curl-src/src/lua/cURL.lua" + dst: "/usr/share/lua/@luaver@/cURL.lua" + + - src: "../../lua-curl-src/src/lua/cURL" + dst: "/usr/share/lua/@luaver@/cURL" + +overrides: + rpm: + depends: + - lua + deb: + depends: + - lua@luaver@ + provides: + - lua@luaver@-curl + conflicts: + - lua@luaver@-curl + replaces: + - lua@luaver@-curl + +rpm: + summary: lua curl + signature: + key_file: ${RPM_SIGNING_KEY_FILE} + key_id: ${RPM_SIGNING_KEY_ID} From bcc0507841e01cab7d663650782970e72ec6bb7c Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Tue, 23 Jul 2024 14:02:46 +0200 Subject: [PATCH 2/2] fix(ci): remove wrong reference to centreon-agent --- .github/workflows/package-collect.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index 7b23883c389..31e7018f04b 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -108,7 +108,7 @@ jobs: if: ${{ matrix.package_extension == 'rpm' }} run: | cd selinux - for MODULE in "centreon-engine" "centreon-broker" "centreon-monitoring-agent"; do + for MODULE in "centreon-engine" "centreon-broker"; do cd $MODULE sed -i "s/@VERSION@/${{ inputs.major_version }}.${{ inputs.minor_version }}/g" $MODULE.te make -f /usr/share/selinux/devel/Makefile @@ -190,8 +190,7 @@ jobs: "build/engine/modules/bench/centengine_bench_passive" "build/connectors/perl/centreon_connector_perl" "build/connectors/ssh/centreon_connector_ssh" - "build/ccc/ccc" - "build/agent/centagent") + "build/ccc/ccc") for file in ${exe[@]}; do echo "Making a debug file of $file" objcopy --only-keep-debug $file $file.debug