Update build-client-deb.yml #39
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 All Packages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build-deb: | |
| runs-on: ubuntu-22.04 | |
| 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 \ | |
| libpq-dev libsystemd-dev \ | |
| php php-cli php-mbstring php-xml \ | |
| libldap2-dev | |
| - 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 | |
| # récupère la version depuis le fichier VERSION | |
| VERSION=$(cat VERSION.txt | tr -d ' \n') | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| git checkout Release/$VERSION | |
| mkdir build | |
| - name: Configure CMake (tous composants) | |
| working-directory: ./bareos-repo | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -DCPACK_PACKAGE_CONTACT="contact@libertech.fr" \ | |
| -DCPACK_PACKAGE_VERSION="${{ env.VERSION }}" \ | |
| -DCPACK_DEBIAN_PACKAGE_MAINTAINER="contact@libertech.fr" \ | |
| -DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst" \ | |
| -Dwebui=ON | |
| cmake --build build -- -j$(nproc) | |
| - name: Make DEB packages | |
| working-directory: ./bareos-repo/build | |
| run: | | |
| # copie des scripts pre/postinst si dispo | |
| cp ./debian/*.preinst ./debian/preinst 2>/dev/null || true | |
| cp ./debian/*.postinst ./debian/postinst 2>/dev/null || true | |
| chmod +x ./debian/preinst ./debian/postinst || true | |
| # génération des paquets pour tous les composants | |
| cpack -G DEB | |
| - name: Upload DEBs as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-all-${{ env.VERSION }} | |
| path: bareos-repo/build/*.deb | |
| - name: Attach DEBs to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: bareos-repo/build/*.deb | |