-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (89 loc) · 3.76 KB
/
ubuntu.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Linux
# Qt官方没有linux平台的x86包
on:
push:
paths:
- '*.pro'
- '**'
- '.github/workflows/ubuntu.yml'
pull_request:
paths:
- '*.pro'
- '**'
- '.github/workflows/ubuntu.yml'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
#os: [ubuntu-18.04,ubuntu-20.04]
# qt_ver: [5.9.9,5.12.10,5.15.2]
os: [ubuntu-22.04]
qt_ver: [5.15.2]
qt_arch: [gcc_64]
env:
targetName: Knot
VERSION: Linux
orgName: Knot
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
#host: linux
cached: 'false'
modules: qtcharts qtwebengine
- name: ubuntu install GL library
run: |
sudo apt-get install -y libglew-dev libglfw3-dev libxcb*
sudo apt-get install libxkbcommon-x11-0
sudo add-apt-repository universe
sudo apt install libfuse2
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: build ubuntu
run: |
qmake
make
- name: install linuxdeployqt
run: |
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
# 打包
- name: package
run: |
cp res/icon.png bin/release/icon.png
cp res/default.desktop bin/release/default.desktop
cp -r qml bin/release/qml
cp ExtBin/libfcitx5platforminputcontextplugin.so /home/runner/work/Knot/Qt/5.15.2/gcc_64/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so
chmod 755 /home/runner/work/Knot/Qt/5.15.2/gcc_64/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so
mkdir bin/release/lib/
cp -r ExtBin/nss/* bin/release/lib/
#cp -r devDatabase bin/release/devDatabase
#chmod +x bin/release/devDatabase/linux/macserial
#chmod +x bin/release/devDatabase/linux/ocvalidate
#chmod +x bin/release/devDatabase/linux/ocpasswordgen
export VERSION # linuxdeployqt uses this for naming the file
./linuxdeployqt-continuous-x86_64.AppImage bin/release/${targetName} -unsupported-allow-new-glibc -appimage -extra-plugins=webview
#chmod +x ${{ env.targetName }}-${{ env.VERSION }}-x86_64.AppImage
# 上传artifacts
- uses: actions/upload-artifact@v2
with:
name: ${{ env.orgName }}-${{ env.VERSION }}-x86_64.AppImage
path: ${{ env.targetName }}-${{ env.VERSION }}-x86_64.AppImage
#name: ${{ env.orgName }}-${{ matrix.os }}-${{ matrix.qt_ver }}-${{ env.VERSION }}-x86_64.AppImage
#path: ${{ env.targetName }}-${{ env.VERSION }}-x86_64.AppImage
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.targetName }}-${{ env.VERSION }}-x86_64.AppImage
asset_name: ${{ env.orgName }}-${{ env.VERSION }}-x86_64.AppImage
#file: ${{ env.targetName }}-${{ env.VERSION }}-x86_64.AppImage
#asset_name: ${{ env.orgName }}-${{ matrix.os }}-${{ matrix.qt_ver }}-${{ env.VERSION }}-x86_64.AppImage
tag: ${{ github.ref }}
overwrite: true