|
1 | | -name: Build Bareos All Packages |
| 1 | +name: Build Bareos DEB Packages |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
9 | 9 | jobs: |
10 | 10 | build-deb: |
11 | 11 | runs-on: ubuntu-22.04 |
12 | | - strategy: |
13 | | - fail-fast: false |
14 | | - matrix: |
15 | | - include: |
16 | | - - distro: bookworm |
17 | | - image: debian:bookworm |
18 | | - |
19 | 12 |
|
20 | 13 | steps: |
21 | 14 | - name: Checkout repository |
22 | 15 | uses: actions/checkout@v4 |
23 | 16 |
|
24 | | - - name: Install dependencies |
| 17 | + - name: Install build dependencies |
25 | 18 | run: | |
26 | 19 | 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 \ |
28 | 22 | libssl-dev zlib1g-dev libacl1-dev liblzo2-dev \ |
29 | 23 | 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 |
43 | 25 |
|
44 | | - - name: Checkout release |
45 | | - working-directory: ./bareos-repo |
| 26 | + - name: Clone Bareos repo |
46 | 27 | run: | |
| 28 | + git clone https://github.com/bareos/bareos.git bareos-repo |
| 29 | + cd bareos-repo |
47 | 30 | 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 |
81 | 32 |
|
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 |
97 | 36 |
|
98 | | - - name: Make STORAGE DEB package |
99 | | - working-directory: ./bareos-repo/build-storage |
| 37 | + - name: Build DEB packages |
| 38 | + working-directory: ./bareos-repo |
100 | 39 | 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 |
109 | 45 |
|
110 | | - - name: Upload storage DEB |
| 46 | + - name: Upload all DEB packages |
111 | 47 | uses: actions/upload-artifact@v4 |
112 | 48 | 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 |
116 | 51 |
|
117 | 52 | - name: Attach DEBs to GitHub Release |
118 | | - uses: softprops/action-gh-release@v1 |
119 | 53 | if: startsWith(github.ref, 'refs/tags/') |
| 54 | + uses: softprops/action-gh-release@v1 |
120 | 55 | with: |
121 | | - files: bareos-repo/build/*.deb |
| 56 | + files: ../*.deb |
122 | 57 |
|
0 commit comments