forked from Greedysky/TTKTinyTools
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (84 loc) · 3.14 KB
/
linux.yml
File metadata and controls
99 lines (84 loc) · 3.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
# Author: Greedysky <greedysky@163.com>
name: linux
on: workflow_call
env:
TTK_MODULE: TTKTinyTools
TTK_VERSION: 3.2.0.0
jobs:
build:
name: Build on Qt${{matrix.qt_major}}(${{matrix.os}})
strategy:
matrix:
qt: [qt5, qt6]
os: [ubuntu-22.04]
include:
- qt: qt5
qt_major: 5
qt_version: 5.15.2
qt_modules:
- qt: qt6
qt_major: 6
qt_version: 6.9.3
qt_modules: qtmultimedia
env:
QT_VERSION: ${{matrix.qt_version}}
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v5
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
target: desktop
modules: ${{matrix.qt_modules}}
cache: 'true'
- name: Add patch for Qt5.15.2
if: env.QT_VERSION == '5.15.2'
shell: bash
run: |
# fix missing <limits> include
# see QTBUG-89977 https://bugreports.qt.io/browse/QTBUG-89977
# see QTBUG-90395 https://bugreports.qt.io/browse/QTBUG-90395
# see QTBUG-93452 https://bugreports.qt.io/browse/QTBUG-93452
# see here https://codereview.qt-project.org/c/qt/qtbase/+/330713
sed -i "46i#include <limits>" "${{env.QT_ROOT_DIR}}/include/QtCore/qfloat16.h"
working-directory: ${{runner.workspace}}
- name: Install linuxdeploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
- name: Install dependencies
run: sudo apt install libfuse2 p7zip-full
- name: Create build dir
run: mkdir build
working-directory: ${{runner.workspace}}
- name: Build project
run: |
qmake -v
cmake --version
cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install -DTTK_QT_VERSION=${{matrix.qt_major}}
make -j2 && make install
working-directory: ${{runner.workspace}}/build
- name: Build package
run: |
cd ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}
# add dependency libraries and so on
linuxdeploy-x86_64.AppImage --executable=TTKBarrage --appdir=image --plugin=qt
rm image/usr/lib/libTTK*.so
mv image/usr/lib image/usr/plugins image/usr/bin/qt.conf ..
rm -rf image
cd ../..
# add dependency for openssl
wget https://github.com/Greedysky/Resource/releases/download/1.0.0.0/openssl.7z
7z x openssl.7z
cp linux64/v3/* ${{env.TTK_MODULE}}/lib
# add portable binary package
7z a ${{env.TTK_MODULE}}-${{env.TTK_VERSION}}-linux-${{matrix.qt}}-x64.7z ${{env.TTK_MODULE}}
working-directory: ${{runner.workspace}}/install
- name: Archive artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{env.TTK_VERSION}}
token: ${{secrets.GITHUB_TOKEN}}
generate_release_notes: false
files: ${{runner.workspace}}/install/${{env.TTK_MODULE}}-${{env.TTK_VERSION}}-linux-${{matrix.qt}}-x64.7z