fix(lua-cffi): wrong version of libffi dependency #367
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: stream-connectors | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/stream-connectors.yml' | |
| - 'centreon-certified/**' | |
| - 'packaging/connectors/**' | |
| push: | |
| branches: | |
| - develop | |
| - master | |
| paths: | |
| - '.github/workflows/stream-connectors.yml' | |
| - 'centreon-certified/**' | |
| - 'packaging/connectors/**' | |
| jobs: | |
| get-environment: | |
| uses: ./.github/workflows/get-environment.yml | |
| detect-changes: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| connectors: ${{ steps.list-connectors.outputs.connectors }} | |
| packaging: ${{ steps.filter.outputs.packaging }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| id: filter | |
| with: | |
| base: ${{ github.ref }} | |
| list-files: shell | |
| filters: | | |
| connectors: | |
| - added|modified: centreon-certified/** | |
| packaging: | |
| - modified: .github/workflows/stream-connectors.yml | |
| - added|modified: packaging/connectors/** | |
| - name: Transform to directories | |
| id: list-connectors | |
| run: | | |
| folders=() | |
| if [ "${{ steps.filter.outputs.packaging }}" = "true" ]; then | |
| echo "Packaging files changed, adding all connectors" | |
| mapfile -t folders < <(find centreon-certified/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \;) | |
| else | |
| for f in ${{ steps.filter.outputs.connectors_files }}; do | |
| DIR_NAME=($(dirname $f)) | |
| BASE_NAME=($(basename $DIR_NAME)) | |
| echo "Adding $BASE_NAME to folders" | |
| folders+=($BASE_NAME) | |
| done | |
| fi | |
| unique_folders=($(printf "%s\n" "${folders[@]}" | sort -u | tr '\n' ' ')) | |
| echo "connectors=$(jq --compact-output --null-input '$ARGS.positional' --args -- ${unique_folders[@]})" >> $GITHUB_OUTPUT | |
| shell: bash | |
| package: | |
| if: ${{ needs.detect-changes.outputs.connectors != '[]' }} | |
| needs: [get-environment, detect-changes] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| distrib: [el8, el9, bullseye, bookworm, jammy] | |
| connector_path: ${{ fromJson(needs.detect-changes.outputs.connectors) }} | |
| include: | |
| - distrib: el8 | |
| image: packaging-stream-connectors-nfpm-alma8 | |
| package_extension: rpm | |
| - distrib: el9 | |
| image: packaging-stream-connectors-nfpm-alma9 | |
| package_extension: rpm | |
| - distrib: bullseye | |
| image: packaging-stream-connectors-nfpm-bullseye | |
| package_extension: deb | |
| - distrib: bookworm | |
| image: packaging-stream-connectors-nfpm-bookworm | |
| package_extension: deb | |
| - distrib: jammy | |
| image: packaging-stream-connectors-nfpm-jammy | |
| package_extension: deb | |
| name: Package ${{ matrix.distrib }} ${{ matrix.connector_path }} | |
| container: | |
| image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest | |
| credentials: | |
| username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} | |
| password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Replace package and connector name variables | |
| run: | | |
| package_name="centreon-stream-connector-`basename ${{ matrix.connector_path }}`" | |
| sed -i "s/@PACKAGE_NAME@/$package_name/g" ./packaging/connectors/centreon-stream-connectors.yaml | |
| connector_name="`basename ${{ matrix.connector_path }}`" | |
| sed -i "s/@CONNECTOR_NAME@/$connector_name/g" ./packaging/connectors/centreon-stream-connectors.yaml | |
| shell: bash | |
| - name: Add specific dependencies | |
| run: | | |
| DEB_DEPENDENCIES="" | |
| RPM_DEPENDENCIES="" | |
| if [ "${{ matrix.connector_path }}" = "kafka" ]; then | |
| DEB_DEPENDENCIES="librdkafka1,lua-cffi" | |
| RPM_DEPENDENCIES="librdkafka,lua-cffi" | |
| elif [ "${{ matrix.connector_path }}" = "pagerduty" ]; then | |
| DEB_DEPENDENCIES="lua-tz" | |
| RPM_DEPENDENCIES="lua-tz" | |
| elif [ "${{ matrix.connector_path }}" = "splunk" ]; then | |
| DEB_DEPENDENCIES="lua-tz" | |
| RPM_DEPENDENCIES="lua-tz" | |
| fi | |
| sed -i "s/@RPM_DEPENDENCIES@/$RPM_DEPENDENCIES/g;" ./packaging/connectors/centreon-stream-connectors.yaml | |
| sed -i "s/@DEB_DEPENDENCIES@/$DEB_DEPENDENCIES/g;" ./packaging/connectors/centreon-stream-connectors.yaml | |
| shell: bash | |
| - name: Export package version | |
| id: package-version | |
| run: echo "package_version=`date '+%Y%m%d'`" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Package | |
| uses: ./.github/actions/package-nfpm | |
| with: | |
| nfpm_file_pattern: "packaging/connectors/centreon-stream-connectors.yaml" | |
| distrib: ${{ matrix.distrib }} | |
| version: ${{ steps.package-version.outputs.package_version }} | |
| release: "1" | |
| package_extension: ${{ matrix.package_extension }} | |
| arch: all | |
| commit_hash: ${{ github.sha }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.connector_path }}-${{ matrix.distrib }} | |
| 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-environment.outputs.stability }} | |
| artifact_name: "package-${{ matrix.connector_path }}-${{ matrix.distrib }}" | |
| deliver-rpm: | |
| if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }} | |
| needs: [get-environment, detect-changes, package] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| distrib: [el8, el9] | |
| connector_path: ${{ fromJson(needs.detect-changes.outputs.connectors) }} | |
| name: Deliver ${{ matrix.distrib }} ${{ matrix.connector_path }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Publish RPM packages | |
| uses: ./.github/actions/rpm-delivery | |
| with: | |
| module_name: stream-connectors | |
| distrib: ${{ matrix.distrib }} | |
| artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.connector_path }}-${{ matrix.distrib }} | |
| stability: ${{ needs.get-environment.outputs.stability }} | |
| deliver-deb: | |
| if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }} | |
| needs: [get-environment, detect-changes, package] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| distrib: [bullseye, bookworm, jammy] | |
| connector_path: ${{ fromJson(needs.detect-changes.outputs.connectors) }} | |
| name: Deliver ${{ matrix.distrib }} ${{ matrix.connector_path }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Publish DEB packages | |
| uses: ./.github/actions/deb-delivery | |
| with: | |
| module_name: stream-connectors | |
| distrib: ${{ matrix.distrib }} | |
| artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.connector_path }}-${{ matrix.distrib }} | |
| stability: ${{ needs.get-environment.outputs.stability }} |