Update build-client-deb.yml #59
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 DEB 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 build dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y build-essential devscripts equivs \ | |
| fakeroot cmake git \ | |
| libssl-dev zlib1g-dev libacl1-dev liblzo2-dev \ | |
| libjansson-dev bison flex \ | |
| libreadline-dev pkg-config | |
| - name: Clone Bareos repo | |
| run: | | |
| git clone https://github.com/bareos/bareos.git bareos-repo | |
| cd bareos-repo | |
| git fetch --all | |
| git checkout Release/24.0.4 # adapte selon la version | |
| - name: Extract version | |
| id: version | |
| run: echo "VERSION=$(cat bareos-repo/VERSION)" >> $GITHUB_ENV | |
| - name: Build DEB packages | |
| working-directory: ./bareos-repo | |
| run: | | |
| # Installe les dépendances nécessaires déclarées dans debian/control | |
| sudo mk-build-deps -i -r -t "apt-get -y" debian/control | |
| # Lance la compilation de tous les paquets | |
| dpkg-buildpackage -us -uc -b | |
| ls -lh ../*.deb | |
| - name: Upload all DEB packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bareos-${{ env.VERSION }}-debs | |
| path: ../*.deb | |
| - name: Attach DEBs to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ../*.deb | |