Skip to content

Commit f157648

Browse files
authored
Merge pull request #711 from razziel89/feature/appimage-in-github-actions
Feature/appimage in GitHub actions
2 parents 74ae511 + d4baaec commit f157648

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

.github/workflows/appimage.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "ci"
2+
3+
on:
4+
push:
5+
tags: "**"
6+
workflow_dispatch:
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
appimage:
14+
runs-on: ubuntu-18.04
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
with:
20+
submodules: true
21+
22+
- name: Install dependencies
23+
run: |
24+
sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic
25+
sudo apt-get update -qq
26+
sudo apt-get install -y \
27+
build-essential make wget libgl1-mesa-dev \
28+
qt515declarative qt515graphicaleffects \
29+
qt515quickcontrols qt515quickcontrols2
30+
31+
- name: Download QT appimage builder
32+
run: |
33+
wget -c -O linuxdeployqt.AppImage \
34+
https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
35+
chmod a+x linuxdeployqt.AppImage
36+
37+
- name: Build project
38+
run: |
39+
source /opt/qt*/bin/qt*-env.sh && \
40+
qmake -v && \
41+
qmake CONFIG+=release PREFIX=/usr && \
42+
make -j$(nproc)
43+
44+
- name: Install to appdir
45+
run: |
46+
source /opt/qt*/bin/qt*-env.sh && \
47+
make INSTALL_ROOT=appdir -j$(nproc) install
48+
49+
- name: Extract version number
50+
run: |
51+
# Extract version for linuxdeployqt to name the file. Use the tag as
52+
# release name but remove prefix.
53+
echo "VERSION=$(echo '${{ github.ref }}' | sed 's;.*/;;')" >> $GITHUB_ENV
54+
55+
- name: Build appimage directory
56+
run: |
57+
mkdir -p \
58+
appdir/usr/bin \
59+
appdir/usr/lib \
60+
appdir/usr/share/applications \
61+
appdir/usr/share/metainfo \
62+
appdir/usr/share/icons/hicolor/128x128/apps
63+
64+
cp cool-retro-term appdir/usr/bin/
65+
cp cool-retro-term.desktop appdir/usr/share/applications/
66+
cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
67+
cp app/icons/128x128/cool-retro-term.png appdir/usr/share/icons/hicolor/128x128/apps/
68+
cp -r ./app/qml appdir/usr/
69+
# Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
70+
cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/
71+
72+
find appdir | sort
73+
74+
- name: Build appimage
75+
run: |
76+
source /opt/qt*/bin/qt*-env.sh && \
77+
./linuxdeployqt.AppImage appdir/usr/share/applications/cool-retro-term.desktop \
78+
-verbose=1 -appimage \
79+
-qmldir=./app/qml/ \
80+
-qmldir=./qmltermwidget/
81+
env:
82+
# Unset environment variables
83+
QTDIR:
84+
QT_PLUGIN_PATH:
85+
LD_LIBRARY_PATH:
86+
87+
- name: Upload release
88+
uses: softprops/action-gh-release@v1
89+
with:
90+
body: appimage release
91+
files: ./**/Cool_Retro_Term-*-x86_64.AppImage
92+
93+
- name: Clean up
94+
if: always()
95+
run: |
96+
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
97+
make clean
98+
rm -rf appdir

0 commit comments

Comments
 (0)