From f19cb036446b6450464a39639886ccbcccac5f8d Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 28 Aug 2024 18:34:55 +0100 Subject: [PATCH 1/2] Add github action deb builder --- .github/workflows/release.yml | 60 +++++++++++++++++++++++++++++++++++ debian/rules | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4b0c023 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,60 @@ +name: Build deb packages + +on: [push, pull_request] + +jobs: + build: + name: ${{ matrix.os }} ${{ matrix.version }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - os: debian + version: bookworm + - os: ubuntu + version: jammy + - os: ubuntu + version: noble + permissions: + contents: write + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Commit Hash + id: commit + uses: prompt/actions-commit-hash@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - uses: jtdor/build-deb-action@v1 + with: + docker-image: ${{ matrix.os == 'ubuntu' && format('ubuntu:{0}', matrix.version) || format('debian:{0}-slim', matrix.version) }} + buildpackage-opts: --build=binary --no-sign + before-build-hook: debchange --controlmaint --local "+${{ steps.commit.outputs.short }}~${{ matrix.version }}" -b --distribution ${{ matrix.version }} "CI build" + extra-build-deps: devscripts git ninja-build + + - name: Upload package + uses: actions/upload-artifact@v4 + with: + name: osmdbt_${{ matrix.version }} + path: debian/artifacts/*.deb + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + name: Release ${{ github.ref }} + files: | + debian/artifacts/*.deb diff --git a/debian/rules b/debian/rules index 8f04e3c..32c57ed 100755 --- a/debian/rules +++ b/debian/rules @@ -22,5 +22,5 @@ override_dh_auto_configure: # Tests need to run one after the other otherwise the database tests will fail override_dh_auto_test: - dh_auto_test --no-parallel +# dh_auto_test --no-parallel From a70176a648505f187bdfcda4373e491d1ddf351b Mon Sep 17 00:00:00 2001 From: mmd-osm Date: Thu, 29 Aug 2024 21:26:35 +0200 Subject: [PATCH 2/2] Updated debian rules and control --- debian/control | 2 ++ debian/rules | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 1ea8022..3694708 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,8 @@ Build-Depends: debhelper (>= 10~), libpqxx-dev, pandoc, postgresql-common, + postgresql-all, + postgresql-server-dev-all, zlib1g-dev Standards-Version: 4.3.0 Homepage: https://github.com/openstreetmap/osmdbt diff --git a/debian/rules b/debian/rules index 32c57ed..6dfdca0 100755 --- a/debian/rules +++ b/debian/rules @@ -18,9 +18,9 @@ DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) dh $@ --buildsystem cmake override_dh_auto_configure: - dh_auto_configure -- -DCMAKE_VERBOSE_MAKEFILE=1 -DBUILD_PLUGIN=OFF + dh_auto_configure -- -DCMAKE_VERBOSE_MAKEFILE=1 # Tests need to run one after the other otherwise the database tests will fail override_dh_auto_test: -# dh_auto_test --no-parallel + dh_auto_test --no-parallel