Skip to content

Commit a614a54

Browse files
gvzGeorg von Zengen
andauthored
build debian packages in github actions (#1146)
* build debian in actions * add ubuntu:24.04 build will enable ubuntu builds * upload .deb files to releases --------- Co-authored-by: Georg von Zengen <[email protected]>
1 parent 9b1b63f commit a614a54

File tree

6 files changed

+161
-0
lines changed

6 files changed

+161
-0
lines changed

.github/workflows/debian.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: debian
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '[0-9]+.[0-9]+.[0-9]+'
9+
pull_request:
10+
types: [opened, synchronize]
11+
12+
jobs:
13+
14+
debian-build:
15+
runs-on: ubuntu-latest
16+
container:
17+
image: ${{ matrix.debian-distro }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
debian-distro:
22+
- debian:bookworm
23+
- debian:trixie
24+
- ubuntu:24.04
25+
26+
steps:
27+
- name: Sync repository
28+
uses: actions/checkout@v4
29+
30+
- name: Define short Distribution name
31+
id: dist_short
32+
shell: bash
33+
working-directory: ${{ github.workspace }}
34+
run: |
35+
SHORT="$(echo '${{ matrix.debian-distro }}' | cut -d':' -f2)"
36+
echo "short_name=$SHORT" >> $GITHUB_OUTPUT
37+
38+
DISTNAME="$(echo '${{ matrix.debian-distro }}' | cut -d':' -f1)"
39+
echo "dist_name=$DISTNAME" >> $GITHUB_OUTPUT
40+
41+
- name: install apt packages
42+
shell: bash
43+
run: |
44+
apt update
45+
apt install -y git qtbase5-dev libqt5svg5-dev libqt5websockets5-dev libqt5opengl5-dev libqt5x11extras5-dev libprotoc-dev libzmq3-dev liblz4-dev libzstd-dev ccache libmosquitto-dev ca-certificates lsb-release wget zsync
46+
47+
- name: Install Apache Arrow for Parquet support
48+
shell: bash
49+
run: |
50+
apt update
51+
apt install -y -V ca-certificates lsb-release wget
52+
wget https://packages.apache.org/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
53+
apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
54+
apt update
55+
apt install -y -V libarrow-dev # For C++
56+
apt install -y -V libparquet-dev # For Apache Parquet C++
57+
58+
- name: Prepare ccache
59+
shell: bash
60+
run: |
61+
mkdir -p ${{ runner.temp }}/ccache/tmp
62+
63+
- name: Save ccache folder
64+
uses: actions/cache@v4
65+
with:
66+
path: ${{ runner.temp }}/ccache
67+
key: ${{ runner.os }}-${{ steps.dist_short.outputs.short_name }}
68+
69+
- name: Build Plotjuggler
70+
shell: bash
71+
working-directory: ${{ github.workspace }}
72+
env:
73+
CCACHE_DIR: ${{ runner.temp }}/ccache
74+
run: |
75+
cmake . -B build -DCMAKE_BUILD_TYPE=Release \
76+
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
77+
cmake --build build
78+
79+
- name: Define version
80+
id: define_version
81+
shell: bash
82+
working-directory: ${{ github.workspace }}
83+
run: |
84+
VERSION="0.0"
85+
if [ '${{github.ref_type}}' == 'tag' ]; then
86+
VERSION=${{github.ref_name}}
87+
fi
88+
echo "version=$VERSION" >> $GITHUB_OUTPUT
89+
90+
91+
- name: Build debian package
92+
shell: bash
93+
working-directory: ${{ github.workspace }}
94+
env:
95+
CCACHE_DIR: ${{ runner.temp }}/ccache
96+
run: |
97+
mkdir plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64
98+
cp -rp DEBIAN plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/
99+
chmod ogu+x plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/postinst
100+
chmod ogu+x plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/preinst
101+
mv plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/_control.'${{ steps.dist_short.outputs.short_name }}' plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/control
102+
rm plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/_*
103+
104+
if [ '${{github.ref_type}}' == 'tag' ]; then
105+
sed -i 's:0\.0:${{github.ref_name}}:g' plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/control
106+
fi
107+
cat plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/DEBIAN/control
108+
mkdir -p plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/lib/plotjuggler
109+
cp -p build/bin/* plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/lib/plotjuggler/
110+
mkdir -p plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/bin
111+
mkdir -p plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/share/applications
112+
cp PlotJuggler.desktop plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/share/applications/
113+
mkdir -p plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/share/icons/hicolor/512x512/apps/
114+
cp plotjuggler.png plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/share/icons/hicolor/512x512/apps/
115+
mkdir -p plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/share/icons/hicolor/scalable/apps/
116+
cp plotjuggler.svg plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64/usr/share/icons/hicolor/scalable/apps/
117+
dpkg-deb --build ./plotjuggler_'${{ steps.define_version.outputs.version }}'_amd64
118+
119+
- name: Upload deb
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: plotjuggler_${{ steps.define_version.outputs.version }}_amd64_${{ steps.dist_short.outputs.short_name }}.deb
123+
path: plotjuggler_${{ steps.define_version.outputs.version }}_amd64.deb
124+
125+
- name: Upload to Release
126+
if: startsWith(github.ref, 'refs/tags/')
127+
uses: softprops/action-gh-release@v2
128+
with:
129+
files: plotjuggler_${{ steps.define_version.outputs.version }}_amd64_${{ steps.dist_short.outputs.short_name }}.deb
130+
generate_release_notes: true

DEBIAN/_control.24.04

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Package: plotjuggler
2+
Version: 0.0
3+
Architecture: amd64
4+
Essential: no
5+
Priority: optional
6+
Depends: libqt5svg5, libqt5websockets5, libqt5opengl5, libqt5x11extras5, libzmq5, liblz4-1, libzstd1, libmosquitto1, ca-certificates, zsync, libqt5concurrent5, libqt5core5a, libqt5dbus5, libqt5gui5, libqt5network5, libqt5printsupport5, libqt5sql5, libqt5test5, libqt5widgets5, libqt5xml5
7+
Maintainer: Davide Faconti <[email protected]>
8+
Homepage: https://github.com/facontidavide/PlotJuggler
9+
Description: PlotJuggler is a tool to visualize time series that is fast, powerful and intuitive.

DEBIAN/_control.bookworm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Package: plotjuggler
2+
Version: 0.0
3+
Architecture: amd64
4+
Essential: no
5+
Priority: optional
6+
Depends: libqt5svg5, libqt5websockets5, libqt5opengl5, libqt5x11extras5, libzmq5, liblz4-1, libzstd1, libmosquitto1, ca-certificates, zsync, libqt5concurrent5, libqt5core5a, libqt5dbus5, libqt5gui5, libqt5network5, libqt5printsupport5, libqt5sql5, libqt5test5, libqt5widgets5, libqt5xml5
7+
Maintainer: Davide Faconti <[email protected]>
8+
Homepage: https://github.com/facontidavide/PlotJuggler
9+
Description: PlotJuggler is a tool to visualize time series that is fast, powerful and intuitive.

DEBIAN/_control.trixie

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Package: plotjuggler
2+
Version: 0.0
3+
Architecture: amd64
4+
Essential: no
5+
Priority: optional
6+
Depends: libqt5svg5, libqt5websockets5, libqt5opengl5, libqt5x11extras5, libzmq5, liblz4-1, libzstd1, libmosquitto1, ca-certificates, zsync, libqt5concurrent5t64, libqt5core5t64, libqt5dbus5t64, libqt5gui5t64, libqt5network5t64, libqt5printsupport5t64, libqt5sql5t64, libqt5test5t64, libqt5widgets5t64, libqt5xml5t64
7+
Maintainer: Davide Faconti <[email protected]>
8+
Homepage: https://github.com/facontidavide/PlotJuggler
9+
Description: PlotJuggler is a tool to visualize time series that is fast, powerful and intuitive.

DEBIAN/postinst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
ln -s /usr/lib/plotjuggler/plotjuggler /usr/bin/plotjuggler

DEBIAN/preinst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/bash

0 commit comments

Comments
 (0)