Create .build-client-deb.yml.swp #17
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: Build Bareos Client DEB | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-deb: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - distro: bookworm | |
| image: debian:bookworm | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y build-essential cmake git \ | |
| libssl-dev zlib1g-dev libacl1-dev liblzo2-dev \ | |
| libjansson-dev bison flex \ | |
| libreadline-dev pkg-config fakeroot | |
| - name: Clone Bareos | |
| run: | | |
| git clone https://github.com/bareos/bareos.git bareos-repo | |
| - name: checkout release | |
| working-directory: ./bareos-repo | |
| run: | | |
| git fetch --all | |
| git checkout Release/24.0.4 # ex: Release/24.0.4 | |
| echo install\(FILES "${CMAKE_BINARY_DIR}/debian/bareos-filedaemon.service" DESTINATION lib/systemd/system\) >>CMakeLists.txt | |
| mkdir ./build | |
| - name: Extract version from tag | |
| id: vars | |
| run: echo "VERSION=${GITHUB_REF_NAME#Release/}" >> $GITHUB_ENV | |
| - name: check work space | |
| run: ls $GITHUB_WORKSPACE/bareos-repo | |
| - name: Build Bareos Client | |
| working-directory: ./bareos-repo/build | |
| run: | | |
| cd build | |
| ls | |
| cmake -Dclient-only=ON \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -DCPACK_PACKAGE_CONTACT="Libertech <contact@libertech.fr>" \ | |
| -DCPACK_PACKAGE_VERSION=24.0.4 \ | |
| -DCPACK_DEBIAN_PACKAGE_MAINTAINER="Libertech <contact@libertech.fr>" \ | |
| -DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \ | |
| -DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst" \ | |
| $GITHUB_WORKSPACE/bareos-repo | |
| # Copier scripts Debian | |
| cp debian/bareos-filedaemon.preinst debian/preinst | |
| cp debian/bareos-filedaemon.postinst debian/postinst | |
| chmod +x debian/preinst debian/postinst | |
| make -j$(nproc) | |
| cpack -G DEB | |
| - name: Upload DEB as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-client-deb-{{ matrix.distro }} | |
| path: bareos-repo/build/*.deb | |
| - name: Attach DEB to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: bareos-repo/build/*.deb | |