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