Skip to content

Commit 65554e0

Browse files
committed
Update build-client-deb.yml
1 parent 57291c7 commit 65554e0

File tree

1 file changed

+24
-89
lines changed

1 file changed

+24
-89
lines changed
Lines changed: 24 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Bareos All Packages
1+
name: Build Bareos DEB Packages
22

33
on:
44
push:
@@ -9,114 +9,49 @@ on:
99
jobs:
1010
build-deb:
1111
runs-on: ubuntu-22.04
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
include:
16-
- distro: bookworm
17-
image: debian:bookworm
18-
1912

2013
steps:
2114
- name: Checkout repository
2215
uses: actions/checkout@v4
2316

24-
- name: Install dependencies
17+
- name: Install build dependencies
2518
run: |
2619
sudo apt update
27-
sudo apt install -y build-essential cmake git \
20+
sudo apt install -y build-essential devscripts equivs \
21+
fakeroot cmake git \
2822
libssl-dev zlib1g-dev libacl1-dev liblzo2-dev \
2923
libjansson-dev bison flex \
30-
libreadline-dev pkg-config fakeroot \
31-
libpq-dev libsystemd-dev \
32-
php php-cli php-mbstring php-xml \
33-
libldap2-dev
34-
35-
- name: Clone Bareos
36-
run: git clone https://github.com/bareos/bareos.git bareos-repo
37-
38-
- name: Extract version from VERSION File
39-
id: vars
40-
run: |
41-
VERSION=$(cat VERSION | tr -d ' \n')
42-
echo "VERSION=$VERSION" >> $GITHUB_ENV
24+
libreadline-dev pkg-config
4325
44-
- name: Checkout release
45-
working-directory: ./bareos-repo
26+
- name: Clone Bareos repo
4627
run: |
28+
git clone https://github.com/bareos/bareos.git bareos-repo
29+
cd bareos-repo
4730
git fetch --all
48-
git checkout Release/${VERSION}
49-
cp CMakeLists.txt CMakeLists.txt.save
50-
- name: Build Bareos Client
51-
working-directory: ./bareos-repo
52-
run: |
53-
echo install\(FILES "build-client/debian/bareos-filedaemon.service" DESTINATION lib/systemd/system\) >>CMakeLists.txt
54-
echo set\(CPACK_PACKAGE_FILE_NAME "bareos-fd-${CPACK_PACKAGE_VERSION}"\) >>CMakeLists.txt
55-
mkdir build-client
56-
cmake -S . -B build-client -Dclient-only=ON \
57-
-DCMAKE_INSTALL_PREFIX=/usr \
58-
-DCPACK_PACKAGE_CONTACT="contact@libertech.fr" \
59-
-DCPACK_PACKAGE_VERSION="${VERSION}" \
60-
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="contact@libertech.fr" \
61-
-DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \
62-
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst"
63-
cmake --build build-client -- -j$(nproc)
64-
- name: Make CLIENT DEB package
65-
working-directory: ./bareos-repo/build-client
66-
run: |
67-
cp debian/bareos-filedaemon.preinst debian/preinst
68-
cp debian/bareos-filedaemon.postinst debian/postinst
69-
chmod +x debian/preinst debian/postinst
70-
cpack -G DEB
71-
echo "--- contents ---"
72-
ls -lisa *.deb
73-
echo "--- end ---"
74-
mv bareos-${VERSION}-Linux.deb bareos-fd-${VERSION}-${{ matrix.distro }}.deb
75-
76-
- name: Upload Filedaemon DEB
77-
uses: actions/upload-artifact@v4
78-
with:
79-
name: bareos-filedaemon-${{ env.VERSION }}-${{ matrix.distro }}
80-
path: bareos-repo/build-client/*.deb
31+
git checkout Release/24.0.4 # adapte selon la version
8132
82-
- name: Build Bareos storage
83-
working-directory: ./bareos-repo
84-
run: |
85-
cp CMakeLists.txt.save CMakeLists.txt
86-
echo install\(FILES "build-client/debian/bareos-storage.service" DESTINATION lib/systemd/system\) >>CMakeLists.txt
87-
echo set\(CPACK_PACKAGE_FILE_NAME "bareos-storage-${CPACK_PACKAGE_VERSION}"\) >>CMakeLists.txt
88-
mkdir build-storage
89-
cmake -S . -B build-storage -Dstorage-only=ON \
90-
-DCMAKE_INSTALL_PREFIX=/usr \
91-
-DCPACK_PACKAGE_CONTACT="contact@libertech.fr" \
92-
-DCPACK_PACKAGE_VERSION="${VERSION}" \
93-
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="contact@libertech.fr" \
94-
-DCPACK_DEBIAN_PACKAGE_DEPENDS="libssl3, zlib1g, libacl1, liblzo2-2, libjansson4, libreadline8" \
95-
-DCPACK_DEBIAN_PACKAGE_CONTROL_EXTRA="debian/preinst;debian/postinst"
96-
cmake --build build-storage -- -j$(nproc)
33+
- name: Extract version
34+
id: version
35+
run: echo "VERSION=$(cat bareos-repo/VERSION)" >> $GITHUB_ENV
9736

98-
- name: Make STORAGE DEB package
99-
working-directory: ./bareos-repo/build-storage
37+
- name: Build DEB packages
38+
working-directory: ./bareos-repo
10039
run: |
101-
cp debian/bareos-storage.preinst debian/preinst
102-
cp debian/bareos-storage.postinst debian/postinst
103-
chmod +x debian/preinst debian/postinst
104-
cpack -G DEB
105-
echo "--- contents ---"
106-
ls -lisa *.deb
107-
echo "--- end ---"
108-
mv bareos-${VERSION}-Linux.deb bareos-storage-${VERSION}-${{ matrix.distro }}.deb
40+
# Installe les dépendances nécessaires déclarées dans debian/control
41+
sudo mk-build-deps -i -r -t "apt-get -y" debian/control
42+
# Lance la compilation de tous les paquets
43+
dpkg-buildpackage -us -uc -b
44+
ls -lh ../*.deb
10945
110-
- name: Upload storage DEB
46+
- name: Upload all DEB packages
11147
uses: actions/upload-artifact@v4
11248
with:
113-
name: bareos-storage-${{ env.VERSION }}-${{ matrix.distro }}
114-
path: bareos-repo/build-storage/*.deb
115-
49+
name: bareos-${{ env.VERSION }}-debs
50+
path: ../*.deb
11651

11752
- name: Attach DEBs to GitHub Release
118-
uses: softprops/action-gh-release@v1
11953
if: startsWith(github.ref, 'refs/tags/')
54+
uses: softprops/action-gh-release@v1
12055
with:
121-
files: bareos-repo/build/*.deb
56+
files: ../*.deb
12257

0 commit comments

Comments
 (0)