Skip to content

build client deb

build client deb #2

name: Build Bareos Client DEB

Check failure on line 1 in .github/workflows/build-client-deb.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-client-deb.yml

Invalid workflow file

(Line: 33, Col: 14): Unexpected symbol: 'ref_name##*/'. Located at position 8 within expression: github.ref_name##*/
on:
push:
tags:
- "Release/*"
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
- name: Clone Bareos
run: |
git clone https://github.com/bareos/bareos.git
cd bareos
git fetch --all
git checkout ${{ github.ref_name }} # ex: Release/24.0.4
- name: Build Bareos Client
working-directory: bareos
run: |
mkdir -p build
cd build
# Copier scripts Debian
cp ../debian/bareos-filedaemon.preinst debian/preinst
cp ../debian/bareos-filedaemon.postinst debian/postinst
chmod +x debian/preinst debian/postinst
cmake -Dclient-only=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCPACK_PACKAGE_CONTACT="Libertech <contact@libertech.fr>" \
-DCPACK_PACKAGE_VERSION=${{ github.ref_name##*/ }} \
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="Libertech <contact@libertech.fr>" \
-DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="$(pwd)/debian/preinst;$(pwd)/debian/postinst" \
..
make -j$(nproc)
cpack -G DEB
- name: Upload DEB as artifact
uses: actions/upload-artifact@v4
with:
name: bareos-client-deb
path: bareos/build/*.deb
- name: Attach DEB to GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: bareos/build/*.deb