From c0a399914dcaebae7d169bafb8e2e141918b2c2e Mon Sep 17 00:00:00 2001 From: Patrick Taibel Date: Wed, 4 Sep 2024 14:49:58 +0200 Subject: [PATCH] Add github actions workflows for fork --- .github/workflows/build.yml | 114 ---------------------------- .github/workflows/build_release.yml | 57 ++++++++++++++ ci/DEBIAN/control | 7 ++ 3 files changed, 64 insertions(+), 114 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/build_release.yml create mode 100644 ci/DEBIAN/control diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c8e7ba3b3..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Build - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macOS-13 - - windows-latest - buildType: - - RelWithDebInfo - include: - - python_version: '3.11' - - os: windows-latest - cmake_extra: '-A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' - - os: macOS-13 - pkg_config_path: '/usr/local/opt/openssl@1.1/lib/pkgconfig' - cmake_extra: '-DBUILD_RUBY=no -DTHREADERCISER=ON' - ctest_extra: '--exclude-regex c-threaderciser' - env: - BuildType: ${{matrix.buildType}} - BuildDir: ${{github.workspace}}/BLD - InstallPrefix: ${{github.workspace}}/INSTALL - PKG_CONFIG_PATH: ${{matrix.pkg_config_path}} - VCPKG_DEFAULT_TRIPLET: x64-windows - steps: - - uses: actions/checkout@v4 - - name: Create Build and Install directories - run: mkdir -p "${BuildDir}" "${InstallPrefix}" - shell: bash - - name: Setup python - uses: actions/setup-python@v5 - with: - cache-dependency-path: python/ci_requirements.txt - python-version: ${{matrix.python_version}} - architecture: x64 - cache: 'pip' - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade -r python/ci_requirements.txt - - name: Install Linux dependencies - if: runner.os == 'Linux' - run: | - sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev - - name: Install Windows dependencies - if: runner.os == 'Windows' - run: | - choco install -y swig --version=4.0.1 - vcpkg install jsoncpp - vcpkg integrate install - - name: Install MacOS dependencies - if: runner.os == 'macOS' - run: | - brew install libuv swig pkgconfig jsoncpp - - name: OTel build/install - if: runner.os == 'Linux' - working-directory: ${{github.workspace}} - run: sudo sh ./ci/otel.sh - shell: bash - - name: cmake configure - working-directory: ${{env.BuildDir}} - run: cmake "${{github.workspace}}" "-DCMAKE_BUILD_TYPE=${BuildType}" "-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" ${{matrix.cmake_extra}} - shell: bash - - name: cmake build/install - run: cmake --build "${BuildDir}" --config ${BuildType} -t install - shell: bash - - name: Upload Install - uses: actions/upload-artifact@v4 - with: - name: qpid_proton_pkg_${{matrix.os}}_${{matrix.buildType}} - path: ${{env.InstallPrefix}} - - name: Upload python source - uses: actions/upload-artifact@v4 - with: - name: python-src_${{matrix.os}} - path: ${{env.BuildDir}}/python/dist/*.tar.gz - - name: Upload python wheel - uses: actions/upload-artifact@v4 - with: - name: python-wheel_${{matrix.os}} - path: ${{env.BuildDir}}/python/dist/*.whl - - id: ctest - name: ctest - working-directory: ${{env.BuildDir}} - run: ctest -C ${BuildType} -V -T Test --no-compress-output ${{matrix.ctest_extra}} - shell: bash - - name: Upload Test results - if: always() && (steps.ctest.outcome == 'failure' || steps.ctest.outcome == 'success') - uses: actions/upload-artifact@v4 - with: - name: Test_Results_${{matrix.os}}_${{matrix.buildType}} - path: ${{env.BuildDir}}/Testing/**/*.xml - - name: Upload Python & C build directories on failure - uses: actions/upload-artifact@v4 - if: failure() - with: - name: Debug-python-C-BLD_${{matrix.os}}_${{matrix.buildType}} - path: | - ${{env.BuildDir}}/c - ${{env.BuildDir}}/python - - name: Environment (Linux/Windows) - if: always() && runner.os != 'macOS' - run: env -0 | sort -z | tr '\0' '\n' - shell: bash - - name: Environment (macOS) - if: always() && runner.os == 'macOS' - run: env | sort - shell: bash diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml new file mode 100644 index 000000000..77e68d5f8 --- /dev/null +++ b/.github/workflows/build_release.yml @@ -0,0 +1,57 @@ +name: Build Debian package + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + container: python:3.12-bookworm + steps: + - uses: actions/checkout@v4 + - name: Generate version string for tag + if: github.ref_type == 'tag' + run: | + REF=${{ github.ref_name }} + REF_STRIPPED=${REF:1} + VERSION=${REF_STRIPPED/-anx.v/.} + echo "VERSION=${VERSION}" >> $GITHUB_ENV + shell: bash + - name: Generate version string for branch + if: github.ref_type != 'tag' + run: | + echo "VERSION=0.0.0" >> $GITHUB_ENV + shell: bash + - name: Install prerequisites + run: | + apt update && apt install -y build-essential cmake pkg-config ninja-build swig ca-certificates libssl-dev libsasl2-dev libwebsockets-dev + pip install -U -r python/ci_requirements.txt + shell: bash + - name: Build + run: | + echo "Building for version ${{ env.VERSION }}" + echo ${{ env.VERSION }} > VERSION.txt + mkdir -p build out + cmake ./ -B build -DCMAKE_INSTALL_PREFIX=install/usr -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DBUILD_CPP=OFF + cmake --build build -t install + cp build/python/dist/* out/ + echo "WHL_FILE=$(echo out/*.whl | xargs -n1 basename)" >> $GITHUB_ENV + cp -r ci/DEBIAN install/ + sed -i s/VERSION/${{ env.VERSION }}/ install/DEBIAN/control + dpkg-deb --build install out/libqpid-proton11-linux_x86_64.deb + shell: bash + - name: Upload .deb file + uses: actions/upload-artifact@v4 + with: + name: libqpid-proton11-linux_x86_64.deb + path: out/libqpid-proton11-linux_x86_64.deb + - name: Upload wheel + uses: actions/upload-artifact@v4 + with: + name: ${{ env.WHL_FILE }} + path: out/${{ env.WHL_FILE }} + - name: Create release + if: github.ref_type == 'tag' + uses: softprops/action-gh-release@v2 + with: + prerelease: true + files: out/* diff --git a/ci/DEBIAN/control b/ci/DEBIAN/control new file mode 100644 index 000000000..9477d7d5f --- /dev/null +++ b/ci/DEBIAN/control @@ -0,0 +1,7 @@ +Package: libqpid-proton11 +Architecture: amd64 +Version: VERSION +Section: libs +Priority: optional +Maintainer: Anexia +Description: Anexia fork build for qpid proton