Skip to content

Commit 3f83983

Browse files
authored
Create main.yml
1 parent c6ef56a commit 3f83983

1 file changed

Lines changed: 122 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Build AppImage
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-linux:
10+
runs-on: ubuntu-latest
11+
container: ubuntu:20.04 # 👈 Run everything inside Ubuntu 20.04
12+
env:
13+
APP_NAME: LikeTaskManager # <- change
14+
PROJ_FILE: LikeTaskManager.pro # <- path to your .pro (relative to repo root)
15+
BUILD_DIR: ${{ github.workspace }}/build
16+
APPDIR: ${{ github.workspace }}/AppDir
17+
QT_VERSION: "6.5.3" # Qt6 LTS version that still has Ubuntu 20.04 binaries
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install system deps
24+
run: |
25+
apt-get update
26+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
27+
build-essential \
28+
libgl1-mesa-dev \
29+
libx11-xcb-dev \
30+
libxcb1 \
31+
libxcb-xinerama0 \
32+
libxkbcommon-x11-0 \
33+
libfontconfig1-dev \
34+
libfuse2 \
35+
wget \
36+
curl \
37+
ca-certificates \
38+
git
39+
40+
- name: Install Qt (qmake + tools)
41+
uses: jurplel/install-qt-action@v4
42+
with:
43+
version: ${{ env.QT_VERSION }}
44+
target: desktop
45+
install-deps: 'true'
46+
cache: 'true'
47+
48+
- name: Show which qmake we have
49+
run: |
50+
which qmake || true
51+
qmake -v || true
52+
53+
- name: Build (qmake)
54+
run: |
55+
set -e
56+
mkdir -p "${{ env.BUILD_DIR }}"
57+
cd "${{ env.BUILD_DIR }}"
58+
qmake "$GITHUB_WORKSPACE/${{ env.PROJ_FILE }}"
59+
make -j$(nproc)
60+
61+
- name: Install into AppDir
62+
run: |
63+
set -e
64+
mkdir -p "${{ env.APPDIR }}"
65+
cd "${{ env.BUILD_DIR }}"
66+
make INSTALL_ROOT="${{ env.APPDIR }}" install
67+
find "${{ env.APPDIR }}" -maxdepth 3 -print
68+
69+
- name: Add .desktop and icon
70+
run: |
71+
mkdir -p "${{ env.APPDIR }}/usr/share/applications"
72+
mkdir -p "${{ env.APPDIR }}/usr/share/icons/hicolor/256x256/apps"
73+
cat > "${{ env.APPDIR }}/usr/share/applications/${{ env.APP_NAME }}.desktop" <<'DESK'
74+
[Desktop Entry]
75+
Type=Application
76+
Name=LikeTaskManager
77+
Exec=LikeTaskManager
78+
Icon=LikeTaskManager
79+
Categories=Utility;
80+
Terminal=false
81+
DESK
82+
if [ -f "$GITHUB_WORKSPACE/icons/myapp-256.png" ]; then
83+
cp "$GITHUB_WORKSPACE/icons/myapp-256.png" \
84+
"${{ env.APPDIR }}/usr/share/icons/hicolor/256x256/apps/myapp.png"
85+
fi
86+
87+
- name: Download linuxdeploy and plugin
88+
run: |
89+
set -e
90+
LDVER=1-alpha-20250213-2
91+
PLUGINQTVER=1-alpha-20250213-1
92+
curl -L -o linuxdeploy-x86_64.AppImage \
93+
"https://github.com/linuxdeploy/linuxdeploy/releases/download/${LDVER}/linuxdeploy-x86_64.AppImage"
94+
chmod +x linuxdeploy-x86_64.AppImage
95+
curl -L -o linuxdeploy-plugin-qt-x86_64.AppImage \
96+
"https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/${PLUGINQTVER}/linuxdeploy-plugin-qt-x86_64.AppImage"
97+
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
98+
99+
- name: Bundle into AppImage
100+
env:
101+
QMAKE: ${{ env.QT_ROOT_DIR }}/bin/qmake
102+
run: |
103+
set -e
104+
PROG="${{ env.APP_NAME }}"
105+
EXE_PATH="${{ env.APPDIR }}/usr/bin/${PROG}"
106+
107+
./linuxdeploy-x86_64.AppImage --appdir "${{ env.APPDIR }}" \
108+
--executable "$EXE_PATH" \
109+
--desktop-file "${{ env.APPDIR }}/usr/share/applications/${{ env.APP_NAME }}.desktop" \
110+
--icon-file "${{ env.APPDIR }}/usr/share/icons/hicolor/256x256/apps/myapp.png" \
111+
--plugin qt \
112+
--output appimage
113+
114+
mkdir -p dist
115+
mv ./*.AppImage dist/ || true
116+
ls -l dist || true
117+
118+
- name: Upload AppImage artifact
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: ${{ env.APP_NAME }}-appimage
122+
path: dist/*.AppImage

0 commit comments

Comments
 (0)