Skip to content

Commit 723b346

Browse files
Add 32- and 64-bit Linux builds, AppImage and .deb
1 parent 88499e1 commit 723b346

File tree

2 files changed

+86
-9
lines changed

2 files changed

+86
-9
lines changed

.gitlab-ci.yml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,86 @@ stages:
2222
before_script:
2323
- echo "started by ${GITLAB_USER_NAME}"
2424

25+
#reusable templates
26+
.ccache_init: &ccache_init
27+
before_script:
28+
- apt update
29+
- apt install -y build-essential qtcreator qt5-default libopenal-dev pkgconf wget git
30+
2531
#-----------------------------------------------------------------------#
26-
# Linux (AppImage) Build Target #
32+
# Linux (AppImage) 32-bit Build Target #
2733
#-----------------------------------------------------------------------#
28-
build_linux:
34+
build_linux_32:
35+
<<: *ccache_init
36+
image: i386/ubuntu:bionic
37+
stage: build
38+
script:
39+
- export $(dpkg-architecture)
40+
- ./scripts/build-appimage.sh
41+
42+
artifacts:
43+
paths:
44+
- Keyboard_Visualizer-i386.AppImage
45+
expire_in: 30 days
46+
47+
#-----------------------------------------------------------------------#
48+
# Linux (AppImage) 64-bit Build Target #
49+
#-----------------------------------------------------------------------#
50+
build_linux_64:
51+
<<: *ccache_init
2952
image: ubuntu:bionic
3053
stage: build
3154
script:
32-
- apt update
33-
- apt install -y build-essential qtcreator qt5-default libopenal-dev pkgconf wget git
55+
- export $(dpkg-architecture)
3456
- ./scripts/build-appimage.sh
3557

3658
artifacts:
3759
paths:
3860
- Keyboard_Visualizer-x86_64.AppImage
3961
expire_in: 30 days
4062

63+
#-----------------------------------------------------------------------#
64+
# Linux (.deb) 32-bit Build Target #
65+
#-----------------------------------------------------------------------#
66+
build_linux_deb32:
67+
<<: *ccache_init
68+
image: i386/ubuntu:bionic
69+
stage: build
70+
script:
71+
- apt install -y debhelper
72+
- dpkg-architecture -l
73+
- dpkg-buildpackage --target-arch i386 -us -B
74+
- rm -v ../keyboardvisualizer-dbgsym*.ddeb
75+
- mv -v ../keyboardvisualizer*.deb ./
76+
77+
artifacts:
78+
paths:
79+
- keyboardvisualizer*.deb
80+
exclude:
81+
- keyboardvisualizer-dbgsym*.deb
82+
expire_in: 30 days
83+
84+
#-----------------------------------------------------------------------#
85+
# Linux (.deb) 64-bit Build Target #
86+
#-----------------------------------------------------------------------#
87+
build_linux_deb64:
88+
<<: *ccache_init
89+
image: ubuntu:bionic
90+
stage: build
91+
script:
92+
- apt install -y debhelper
93+
- dpkg-architecture -l
94+
- dpkg-buildpackage -us -B
95+
- rm -v ../keyboardvisualizer-dbgsym*.ddeb
96+
- mv -v ../keyboardvisualizer*.deb ./
97+
98+
artifacts:
99+
paths:
100+
- keyboardvisualizer*.deb
101+
exclude:
102+
- keyboardvisualizer-dbgsym*.deb
103+
expire_in: 30 days
104+
41105
#-----------------------------------------------------------------------#
42106
# Windows (32-bit) Build Target #
43107
#-----------------------------------------------------------------------#

scripts/build-appimage.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ fi
2020

2121
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" appimage-build-XXXXXX)
2222

23+
#-----------------------------------------------------------------------#
24+
# This checks the Architecture of the system to work out if we're #
25+
# building on i386 or x86_64 and saves for later use #
26+
#-----------------------------------------------------------------------#
27+
28+
if [ ${DEB_HOST_ARCH:0:1} == ${DEB_HOST_GNU_CPU:0:1} ]; then
29+
ARCH="$DEB_HOST_ARCH"
30+
else
31+
ARCH="$DEB_HOST_GNU_CPU"
32+
fi
33+
echo Inputs: "$DEB_HOST_ARCH" "$DEB_HOST_GNU_CPU"
34+
echo Calculated: "$ARCH"
35+
2336
#-----------------------------------------------------------------------#
2437
# Make sure to clean up build dir, even if errors occur #
2538
#-----------------------------------------------------------------------#
@@ -51,7 +64,7 @@ qmake "$REPO_ROOT"
5164
#-----------------------------------------------------------------------#
5265
# Build project and install files into AppDir #
5366
#-----------------------------------------------------------------------#
54-
make -j$(nproc)
67+
make -j$(nproc) TARGET="$TARGET"
5568
make install INSTALL_ROOT=AppDir
5669

5770
#-----------------------------------------------------------------------#
@@ -64,12 +77,12 @@ chmod +x "$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy*.AppImage
6477
# files #
6578
export QML_SOURCES_PATHS="$REPO_ROOT"/src
6679

67-
"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir AppDir -e KeyboardVisualizer -i "$REPO_ROOT"/KeyboardVisualizerQT/KeyboardVisualizer.png -d "$REPO_ROOT"/KeyboardVisualizerQT/KeyboardVisualizer.desktop
68-
"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract-and-run --appdir AppDir
69-
"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir AppDir --output appimage
80+
"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir -e "$TARGET" -i "$REPO_ROOT"/KeyboardVisualizerQT/KeyboardVisualizer.png -d "$REPO_ROOT"/KeyboardVisualizerQT/KeyboardVisualizer.desktop
81+
"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-plugin-qt-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir
82+
"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir --output appimage
7083

7184
#-----------------------------------------------------------------------#
7285
# Move built AppImage back into original CWD #
7386
#-----------------------------------------------------------------------#
74-
mv Keyboard_Visualizer*.AppImage "$OLD_CWD"
87+
mv "$TARGET"*.AppImage "$OLD_CWD"
7588

0 commit comments

Comments
 (0)