From e890ff0f1382ec6d92b72c1bc16b9d9686707777 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Mon, 23 Sep 2024 09:34:31 +0200 Subject: [PATCH] Build package for Clixon. --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++++++++++++++-- debian/clixon7.install | 1 + debian/control | 18 ++++++++++ debian/rules | 11 ++++++ 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 debian/clixon7.install create mode 100644 debian/control create mode 100755 debian/rules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9cb2b9d..378fd146 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: make install run: sudo make install install-include - name: make example - run: (cd example; make) + run: (cd example; make) - name: install example run: (cd example; sudo make install) ubuntu-build-restconf-fcgi: @@ -48,7 +48,7 @@ jobs: - name: make install run: sudo make install install-include - name: make example - run: (cd example; make) + run: (cd example; make) - name: install example run: (cd example; sudo make install) @@ -175,3 +175,72 @@ jobs: run: ./start.sh - name: run test r-y run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh" ./sum.sh' + + reset-run-number: + runs-on: ubuntu-latest + outputs: + run-number: ${{ steps.get-build.outputs.build-number }} + steps: + - name: Get build number and reset it + id: get-build + uses: mlilback/build-number@v1 + with: + base: 0 # Update this number to reset counter + run-id: ${{ github.run_number }} + + create_deb_packet: + needs: reset-run-number + #if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + env: + VERSION: "7.1.0" + RUN_NUMBER: ${{ needs.reset-run-number.outputs.run-number }} + permissions: write-all + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + - name: create dir for build + run: mkdir ${{ github.workspace }}/build + - name: Install dependencies + run: sudo apt update && sudo apt install -y build-essential flex fakeroot bison lsb-release make debhelper libnghttp2-dev libssl-dev git + - name: Clone cligen + run: git clone https://github.com/clicon/cligen.git + - name: Install cligen + run: (cd cligen; ./configure; make; sudo make install) + - name: configure + run: ./configure + - name: make + run: make + - name: install + run: sudo make install + - name: configure + run: ./configure + - name: make + run: make + - name: install + run: sudo make install DESTDIR=${{ github.workspace }}/build + - name: copy file for build deb packet dev + run: cp -r ${{ github.workspace }}/debian ${{ github.workspace }}/build + - name: add change log + run: cd ${{ github.workspace }}/build/debian && export NAME_VERSION="clixon (${{env.VERSION}}-${{env.RUN_NUMBER}})" && git --no-pager log --no-walk --encoding=utf-8 --expand-tabs=4 --pretty=format:"${NAME_VERSION} stable; urgency=medium%n%n * %w(,,2)%B%w()%n -- %an <%ae> %aD%n" > changelog && cat changelog + - name: run build packet + run: cd ${{ github.workspace }}/build && dpkg-buildpackage -us -uc + - name: show directory + run: ls -l ${{ github.workspace }} + - name: Create deb packet + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.VERSION}}_${{env.RUN_NUMBER}} + release_name: clixon_${{env.VERSION}}-${{env.RUN_NUMBER}} + draft: false + prerelease: false + - name: Upload artefact (clixon) + uses: actions/upload-artifact@v4 + with: + name: clixon7_${{env.VERSION}}-${{env.RUN_NUMBER}}_amd64.deb + path: ${{ github.workspace }}/clixon7_${{env.VERSION}}-${{env.RUN_NUMBER}}_amd64.deb diff --git a/debian/clixon7.install b/debian/clixon7.install new file mode 100644 index 00000000..e25db584 --- /dev/null +++ b/debian/clixon7.install @@ -0,0 +1 @@ +/usr \ No newline at end of file diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..33fb141e --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: clixon +Section: devel +Priority: optional +Maintainer: olof@hagsand.se +Build-Depends: + debhelper-compat (= 12), + flex, + bison, + libnghttp2-dev, + libssl-dev +Standards-Version: 4.5.0 + +Package: clixon7 +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Clixon package \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..30ccd0dd --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_usrlocal: + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info