enh(stream-connectors-lib): package lsqlite3 #4
Workflow file for this run
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: lua-lsqlite3 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/lua-lsqlite3.yml' | |
| - 'dependencies/lua-lsqlite3/**' | |
| push: | |
| branches: | |
| - develop | |
| - master | |
| paths: | |
| - '.github/workflows/lua-lsqlite3.yml' | |
| - 'dependencies/lua-lsqlite3/**' | |
| jobs: | |
| dependency-scan: | |
| uses: centreon/security-tools/.github/workflows/dependency-analysis.yml@main | |
| get-environment: | |
| needs: [dependency-scan] | |
| uses: ./.github/workflows/get-environment.yml | |
| package: | |
| needs: [get-environment] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distrib: [el8, el9, el10, bullseye, bookworm, trixie, jammy, noble] | |
| include: | |
| - distrib: el8 | |
| package_extension: rpm | |
| image: packaging-stream-connectors-nfpm-alma8 | |
| lua_version: 5.3 | |
| - distrib: el9 | |
| package_extension: rpm | |
| image: packaging-stream-connectors-nfpm-alma9 | |
| lua_version: 5.4 | |
| - distrib: el10 | |
| package_extension: rpm | |
| image: packaging-stream-connectors-nfpm-alma10 | |
| lua_version: 5.4 | |
| - distrib: bullseye | |
| package_extension: deb | |
| image: packaging-stream-connectors-nfpm-bullseye | |
| lua_version: 5.3 | |
| - distrib: bookworm | |
| package_extension: deb | |
| image: packaging-stream-connectors-nfpm-bookworm | |
| lua_version: 5.3 | |
| - distrib: trixie | |
| package_extension: deb | |
| image: packaging-stream-connectors-nfpm-trixie | |
| lua_version: 5.4 | |
| - distrib: jammy | |
| package_extension: deb | |
| image: packaging-stream-connectors-nfpm-jammy | |
| lua_version: 5.3 | |
| - distrib: noble | |
| package_extension: deb | |
| image: packaging-stream-connectors-nfpm-noble | |
| lua_version: 5.3 | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest | |
| credentials: | |
| username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} | |
| password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} | |
| name: package ${{ matrix.distrib }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Prepare packaging of lua-lsqlite3 | |
| env: | |
| PACKAGE_EXTENSION: ${{ matrix.package_extension }} | |
| LUA_VERSION: ${{ matrix.lua_version }} | |
| LSQLITE3_VERSION: 0.9.7 | |
| run: | | |
| if [ "$PACKAGE_EXTENSION" = "rpm" ]; then | |
| dnf install -y make gcc lua-devel unzip wget sqlite sqlite-devel | |
| else | |
| apt-get update | |
| apt-get install -y make gcc liblua${LUA_VERSION}-dev unzip wget sqlite3 libsqlite3-dev | |
| fi | |
| wget -O lsqlite3.zip "https://lua.sqlite.org/home/zip/lsqlite3_v097.zip?uuid=v${LSQLITE3_VERSION}" | |
| unzip lsqlite3.zip | |
| mv lsqlite3_v097 lsqlite3_v${LSQLITE3_VERSION} | |
| if [ "$PACKAGE_EXTENSION" = "rpm" ]; then | |
| LUA_INCDIR="/usr/include" | |
| else | |
| LUA_INCDIR="/usr/include/lua${LUA_VERSION}" | |
| fi | |
| cd lsqlite3_v${LSQLITE3_VERSION} | |
| gcc -O2 -fPIC -shared -o lsqlite3.so lsqlite3.c -DLSQLITE_VERSION='"${LSQLITE3_VERSION}"' $(pkg-config --cflags lua${LUA_VERSION}) $(pkg-config --cflags --libs sqlite3) | |
| shell: bash | |
| - name: Package | |
| uses: ./.github/actions/package-nfpm | |
| with: | |
| nfpm_file_pattern: "dependencies/lua-lsqlite3/packaging/*.yaml" | |
| distrib: ${{ matrix.distrib }} | |
| package_extension: ${{ matrix.package_extension }} | |
| arch: amd64 | |
| version: "0.9.7" | |
| release: "1" | |
| commit_hash: ${{ github.sha }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-lua-lsqlite3-${{ 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-lua-lsqlite3-${{ matrix.distrib }}" | |
| test-packages: | |
| needs: [get-environment, package] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - package_extension: rpm | |
| image: almalinux:8 | |
| distrib: el8 | |
| - package_extension: rpm | |
| image: almalinux:9 | |
| distrib: el9 | |
| - package_extension: rpm | |
| image: almalinux:10 | |
| distrib: el10 | |
| - package_extension: deb | |
| image: debian:bullseye | |
| distrib: bullseye | |
| - package_extension: deb | |
| image: debian:bookworm | |
| distrib: bookworm | |
| - package_extension: deb | |
| image: debian:trixie | |
| distrib: trixie | |
| - package_extension: deb | |
| image: ubuntu:jammy | |
| distrib: jammy | |
| - package_extension: deb | |
| image: ubuntu:noble | |
| distrib: noble | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: ${{ matrix.image }} | |
| name: Test lua packages on ${{ matrix.package_extension }} ${{ matrix.distrib }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Test packaged libs | |
| uses: ./.github/actions/test-packages | |
| with: | |
| package_extension: ${{ matrix.package_extension }} | |
| distrib: ${{ matrix.distrib }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-lua-lsqlite3-${{ matrix.distrib }} | |
| - name: Upload error log | |
| if: failure() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: install_error_log_${{ matrix.distrib }} | |
| path: install_error_${{ matrix.distrib }}.log | |
| deliver-rpm: | |
| if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }} | |
| needs: [get-environment, package, test-packages] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| distrib: [el8, el9, el10] | |
| name: deliver ${{ matrix.distrib }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Publish RPM packages | |
| uses: ./.github/actions/rpm-delivery | |
| with: | |
| module_name: lua-lsqlite3 | |
| distrib: ${{ matrix.distrib }} | |
| artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-lua-lsqlite3-${{ matrix.distrib }} | |
| stability: ${{ needs.get-environment.outputs.stability }} | |
| deliver-deb: | |
| if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }} | |
| needs: [get-environment, package, test-packages] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| distrib: [bullseye, bookworm, trixie, jammy, noble] | |
| name: deliver ${{ matrix.distrib }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Publish DEB packages | |
| uses: ./.github/actions/deb-delivery | |
| with: | |
| module_name: lua-lsqlite3 | |
| distrib: ${{ matrix.distrib }} | |
| artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | |
| cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-lua-lsqlite3-${{ matrix.distrib }} | |
| stability: ${{ needs.get-environment.outputs.stability }} |