Skip to content

Commit 9b24394

Browse files
committed
Update build-client-deb.yml
1 parent d61736c commit 9b24394

File tree

1 file changed

+28
-35
lines changed

1 file changed

+28
-35
lines changed

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

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
name: Build Bareos Client DEB
1+
name: Build Bareos All Packages
22

33
on:
44
push:
55
branches:
66
- main
7+
pull_request:
78

89
jobs:
910
build-deb:
1011
runs-on: ubuntu-22.04
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
include:
15-
- distro: bookworm
16-
image: debian:bookworm
17-
- distro: trixie
18-
image: debian:trixie
19-
2012

2113
steps:
2214
- name: Checkout repository
@@ -28,52 +20,53 @@ jobs:
2820
sudo apt install -y build-essential cmake git \
2921
libssl-dev zlib1g-dev libacl1-dev liblzo2-dev \
3022
libjansson-dev bison flex \
31-
libreadline-dev pkg-config fakeroot
23+
libreadline-dev pkg-config fakeroot \
24+
libpq-dev libsystemd-dev \
25+
php php-cli php-mbstring php-xml \
26+
libldap2-dev
3227
3328
- name: Clone Bareos
34-
run: |
35-
git clone https://github.com/bareos/bareos.git bareos-repo
36-
- name: checkout release
29+
run: git clone https://github.com/bareos/bareos.git bareos-repo
30+
31+
- name: Checkout release
3732
working-directory: ./bareos-repo
3833
run: |
3934
git fetch --all
40-
git checkout Release/24.0.4 # ex: Release/24.0.4
41-
echo install\(FILES "build/debian/bareos-filedaemon.service" DESTINATION lib/systemd/system\) >>CMakeLists.txt
42-
mkdir ./build
43-
ls
44-
45-
- name: Extract version from VERSION File
46-
id: vars
47-
run: |
35+
# récupère la version depuis le fichier VERSION
4836
VERSION=$(cat VERSION | tr -d ' \n')
4937
echo "VERSION=$VERSION" >> $GITHUB_ENV
50-
51-
- name: Build Bareos Client
38+
git checkout Release/$VERSION
39+
mkdir build
40+
41+
- name: Configure CMake (tous composants)
5242
working-directory: ./bareos-repo
5343
run: |
54-
cmake -S . -B build -Dclient-only=ON \
44+
cmake -S . -B build \
5545
-DCMAKE_INSTALL_PREFIX=/usr \
5646
-DCPACK_PACKAGE_CONTACT="contact@libertech.fr" \
57-
-DCPACK_PACKAGE_VERSION="${VERSION}" \
47+
-DCPACK_PACKAGE_VERSION="${{ env.VERSION }}" \
5848
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="contact@libertech.fr" \
59-
-DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \
60-
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst"
49+
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst" \
50+
-Dwebui=ON
6151
cmake --build build -- -j$(nproc)
6252
63-
- name: Make DEB package
53+
- name: Make DEB packages
6454
working-directory: ./bareos-repo/build
6555
run: |
66-
cp ./debian/bareos-filedaemon.preinst ./debian/preinst
67-
cp ./debian/bareos-filedaemon.postinst ./debian/postinst
68-
chmod +x ./debian/preinst ./debian/postinst
56+
# copie des scripts pre/postinst si dispo
57+
cp ./debian/*.preinst ./debian/preinst 2>/dev/null || true
58+
cp ./debian/*.postinst ./debian/postinst 2>/dev/null || true
59+
chmod +x ./debian/preinst ./debian/postinst || true
60+
# génération des paquets pour tous les composants
6961
cpack -G DEB
70-
- name: Upload DEB as artifact
62+
63+
- name: Upload DEBs as artifact
7164
uses: actions/upload-artifact@v4
7265
with:
73-
name: bareos-client-deb-${{ matrix.distro }}
66+
name: bareos-all-${{ env.VERSION }}
7467
path: bareos-repo/build/*.deb
7568

76-
- name: Attach DEB to GitHub Release
69+
- name: Attach DEBs to GitHub Release
7770
uses: softprops/action-gh-release@v1
7871
if: startsWith(github.ref, 'refs/tags/')
7972
with:

0 commit comments

Comments
 (0)