Skip to content

Commit 8043515

Browse files
committed
feat(ci): add AppImage
1 parent fe62144 commit 8043515

File tree

3 files changed

+103
-3
lines changed

3 files changed

+103
-3
lines changed

.github/workflows/linux.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Linux Build
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- .github/workflows/docker.yml
9+
- .github/workflows/windows.yml
10+
pull_request:
11+
branches:
12+
- main
13+
paths-ignore:
14+
- .github/workflows/docker.yml
15+
- .github/workflows/windows.yml
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
name: build (${{ matrix.config.name }})
21+
strategy:
22+
# needs to be set; reduce if github is cancelling jobs
23+
max-parallel: 2
24+
matrix:
25+
config:
26+
- name: "AppImage"
27+
container: "ghcr.io/scrubbbbs/appimage:latest"
28+
submodules: false
29+
deps: ""
30+
cmake_flags: ""
31+
env: ""
32+
33+
container:
34+
image: ${{ matrix.config.container }}
35+
credentials:
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
ref: ${{ github.event.pull_request.head.sha }}
43+
44+
- name: Allow unsafe git in container
45+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
46+
47+
- name: Checkout submodules
48+
if: matrix.config.submodules
49+
run: |
50+
git submodule init
51+
git submodule update
52+
53+
#- name: Install build dependencies
54+
# run: |
55+
# sudo apt-get update
56+
57+
- name: Configure
58+
shell: bash
59+
run: |
60+
${{ matrix.config.env }} qmake6
61+
62+
- name: Build
63+
shell: bash
64+
run: |
65+
${{ matrix.config.env }} make -j$(nproc)
66+
67+
- name: Get Build Info
68+
shell: bash
69+
id: get_version
70+
run: |
71+
ARCH=$(uname --machine)
72+
OS=$(source /etc/lsb-release; echo $DISTRIB_ID-$DISTRIB_RELEASE)
73+
SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha || github.sha }})
74+
VERSION=$(cat _win32/git.h | grep CBIRD_VERSION | sed 's/[^0-9\.]*//g')
75+
echo "ARCH=$ARCH" >> $GITHUB_OUTPUT
76+
echo "BUILD=${VERSION}-${SHA}-${OS}-${ARCH}" >> $GITHUB_OUTPUT
77+
78+
- name: Build AppImage
79+
shell: bash
80+
run: |
81+
make appimage
82+
83+
- name: Upload Artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: "cbird-${{ steps.get_version.outputs.BUILD }}-${{ matrix.config.name }}"
87+
path: cbird-${{ steps.get_version.outputs.ARCH }}.AppImage
88+
retention-days: 30
89+

cbird.pro

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ unix:!macx: {
159159
#message($$[QT_INSTALL_LIBS]);
160160
APPDIR=$$OBJECTS_DIR/appimage
161161
LINUXDEPLOYQT=~/Downloads/linuxdeployqt-continuous-x86_64.AppImage
162-
appimage.commands = (rm -rf $$APPDIR && \
162+
appimage_disable.commands = (rm -rf $$APPDIR && \
163163
PREFIX="$$APPDIR/cbird" $$QMAKE_QMAKE && \
164164
make install && \
165165
cp -auv /usr/local/bin/ff* $$APPDIR/cbird/bin/ && \
@@ -173,6 +173,17 @@ unix:!macx: {
173173
-qmake=$$QMAKE_QMAKE \
174174
-appimage)
175175

176+
appimage.commands = (rm -rf $$APPDIR && \
177+
PREFIX="$$APPDIR/usr" $$QMAKE_QMAKE && \
178+
make install && \
179+
(cp -auv /usr/local/bin/ff* $$APPDIR/usr/bin/ || echo 0) && \
180+
LDAI_NO_APPSTREAM=1 \
181+
QMAKE=$$QMAKE_QMAKE \
182+
EXTRA_QT_PLUGINS=waylandcompositor \
183+
EXTRA_PLATFORM_PLUGINS=libqwayland.so \
184+
linuxdeploy --appdir $$APPDIR --plugin=qt --output appimage --verbosity=2 \
185+
--desktop-file=$$APPDIR/usr/share/applications/cbird.desktop \
186+
)
176187
QMAKE_EXTRA_TARGETS += appimage
177188
}
178189

src/qtutil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ bool DesktopHelper::runProgram(QStringList& args, bool wait, const QString& inPa
267267
libDir = appDir + "/";
268268
} else if (!appDir.isEmpty()) {
269269
setEnv = true;
270-
binDir = appDir + "/cbird/bin/";
271-
libDir = appDir + "/cbird/lib/";
270+
binDir = appDir + "/usr/bin/";
271+
libDir = appDir + "/usr/lib/";
272272
}
273273

274274
if (setEnv)

0 commit comments

Comments
 (0)