Update build-client-deb.yml #41
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: Extract version from VERSION File | |
| id: vars | |
| run: | | |
| VERSION=$(cat VERSION | tr -d ' \n') | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Checkout release | |
| working-directory: ./bareos-repo | |
| run: | | |
| git fetch --all | |
| 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 Filedaemon DEB | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-filedaemon-${{ env.VERSION }} | |
| path: bareos-repo/build/*filedaemon*.deb | |
| - name: Upload Director DEB | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-director-${{ env.VERSION }} | |
| path: bareos-repo/build/*director*.deb | |
| - name: Upload Storage DEB | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-storage-${{ env.VERSION }} | |
| path: bareos-repo/build/*storage*.deb | |
| - name: Upload WebUI DEB | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-webui-${{ env.VERSION }} | |
| path: bareos-repo/build/*webui*.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 | |