Skip to content

Update build-client-deb.yml #56

Update build-client-deb.yml

Update build-client-deb.yml #56

name: Build Bareos All Packages
on:
push:
branches:
- main
pull_request:
jobs:
build-deb:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- distro: bookworm
image: debian:bookworm
- distro: trixie
image: debian:trixie
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}
cp CMakeLists.txt CMakeLists.txt.save
- name: Build Bareos Client
working-directory: ./bareos-repo
run: |
echo install\(FILES "build-client/debian/bareos-filedaemon.service" DESTINATION lib/systemd/system\) >>CMakeLists.txt
echo set\(CPACK_PACKAGE_FILE_NAME "bareos-fd-${CPACK_PACKAGE_VERSION}"\) >>CMakeLists.txt
mkdir build-client
cmake -S . -B build-client -Dclient-only=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCPACK_PACKAGE_CONTACT="contact@libertech.fr" \
-DCPACK_PACKAGE_VERSION="${VERSION}" \
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="contact@libertech.fr" \
-DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst"
cmake --build build-client -- -j$(nproc)
- name: Make CLIENT DEB package
working-directory: ./bareos-repo/build-client
run: |
cp debian/bareos-filedaemon.preinst debian/preinst
cp debian/bareos-filedaemon.postinst debian/postinst
chmod +x debian/preinst debian/postinst
cpack -G DEB
echo "--- contents ---"
ls -lisa *.deb
echo "--- end ---"
mv bareos-${VERSION}-Linux.deb bareos-fd-${VERSION}-${{ matrix.distro }}.deb
- name: Upload Filedaemon DEB
uses: actions/upload-artifact@v4
with:
name: bareos-filedaemon-${{ env.VERSION }}-${{ matrix.distro }}
path: bareos-repo/build-client/*.deb
- name: Build Bareos storage
working-directory: ./bareos-repo
run: |
cp CMakeLists.txt.save CMakeLists.txt
echo install\(FILES "build-client/debian/bareos-storage.service" DESTINATION lib/systemd/system\) >>CMakeLists.txt
echo set\(CPACK_PACKAGE_FILE_NAME "bareos-storage-${CPACK_PACKAGE_VERSION}"\) >>CMakeLists.txt
mkdir build-storage
cmake -S . -B build-storage -Dstorage-only=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCPACK_PACKAGE_CONTACT="contact@libertech.fr" \
-DCPACK_PACKAGE_VERSION="${VERSION}" \
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="contact@libertech.fr" \
-DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst"
cmake --build build-storage -- -j$(nproc)
- name: Make CLIENT DEB package
working-directory: ./bareos-repo/build-storage
run: |
cp debian/bareos-storage.preinst debian/preinst
cp debian/bareos-storage.postinst debian/postinst
chmod +x debian/preinst debian/postinst
cpack -G DEB
echo "--- contents ---"
ls -lisa *.deb
echo "--- end ---"
mv bareos-${VERSION}-Linux.deb bareos-storage-${VERSION}-${{ matrix.distro }}.deb
- name: Upload storage DEB
uses: actions/upload-artifact@v4
with:
name: bareos-filedaemon-${{ env.VERSION }}-${{ matrix.distro }}
path: bareos-repo/storage-client/*.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