-
-
Notifications
You must be signed in to change notification settings - Fork 78
159 lines (144 loc) · 8.16 KB
/
linux.yml
File metadata and controls
159 lines (144 loc) · 8.16 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Author: Kang Lin <kl222@126.com>
name: linux
on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_linux.outputs.name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
build_linux:
strategy:
matrix:
BUILD_TYPE: [Release]
qt_version: [6.9.3]
os: [ubuntu-24.04, ubuntu-24.04-arm] #, ubuntu-22.04, ubuntu-22.04-arm]
PACKAGE: [deb] #, appimage]
exclude:
- os: ubuntu-22.04
PACKAGE: appimage
- os: ubuntu-22.04-arm
PACKAGE: appimage
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
# See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
# See: https://github.com/actions/runner-images/
runs-on: ${{matrix.os}}
env:
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
BUILD_DIR: ${{github.workspace}}/build
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOLS_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.os}}_${{matrix.BUILD_TYPE}}
BUILD_VERBOSE: ON
RabbitRemoteControl_VERSION: 1.0.0-dev
artifact_name: build_linux
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Make directories
run: |
cmake -E make_directory ${{env.BUILD_DIR}}
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: Cache installed
uses: actions/cache@v4
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
${{env.TOOLS_DIR}}/linuxdeploy-*
${{env.TOOLS_DIR}}/qt_*
key: install_linux_${{matrix.os}}
- name: build linux
#continue-on-error: true
run: |
sudo ./Script/build_linux.sh --${{matrix.PACKAGE}} --install=${{env.INSTALL_DIR}}
- name: Deb update configure file
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.PACKAGE == 'deb' }}
working-directory: ${{github.workspace}}
#continue-on-error: true
run: |
#sudo apt update -y -qq
#sudo apt-get install -y -qq xvfb xpra
sudo Xvfb :92 -ac -screen 0 1200x900x24 &
export DISPLAY=:92.0
ARCH=`dpkg --print-architecture`
cp ../rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${ARCH}.deb rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb
md5sum rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb > rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb.md5sum
echo "Install rabbit remote control ......"
sudo apt install ./rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb
echo "Update update_linux.json ......"
export QT_XCB_GL_INTEGRATION=none
MD5SUM=`cat rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb.md5sum|awk '{print $1}'`
echo "MD5SUM rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb: ${MD5SUM}"
echo "Generate update configure file ......"
/opt/RabbitRemoteControl/bin/RabbitRemoteControlApp \
-f "${{github.workspace}}/update_ubuntu.json" \
--foc 1 \
-u "https://github.com/KangLin/RabbitRemoteControl/releases/download/v${{env.RabbitRemoteControl_VERSION}}/rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_`dpkg --print-architecture`.deb;https://master.dl.sourceforge.net/project/rabbitremotecontrol/v${{env.RabbitRemoteControl_VERSION}}/rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_`dpkg --print-architecture`.deb?viasf=1" \
--md5 "${MD5SUM}"
mv "${{github.workspace}}/update_ubuntu.json.xml" update_linux.xml
- name: Deb update version configure file
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.PACKAGE == 'deb' && 'ubuntu-24.04' == matrix.os}}
working-directory: ${{github.workspace}}
#continue-on-error: true
run: |
sudo Xvfb :90 -ac &
export DISPLAY=:90.0
/opt/RabbitRemoteControl/bin/RabbitRemoteControlApp \
-f "${{github.workspace}}/version.json" \
--foc 0 \
--pv ${{env.RabbitRemoteControl_VERSION}}
- name: AppIagme update configure file
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.PACKAGE == 'appimage' }}
#continue-on-error: true
run: |
sudo Xvfb :91.0 -ac -screen 0 1200x900x24 &
sleep 1
export DISPLAY=:91.0
echo "Update update_linux.json ......"
export QT_XCB_GL_INTEGRATION=none
#export QT_DEBUG_PLUGINS=1
ARCH=`uname -m`
cp RabbitRemoteControl_${ARCH}.AppImage RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage
mkdir -p RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup
pushd RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup
cp ${{github.workspace}}/RabbitRemoteControl_${ARCH}.AppImage RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage
chmod a+x RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage
cp ${{github.workspace}}/build_appimage/AppDir/usr/share/applications/io.github.KangLin.RabbitRemoteControl.desktop io.github.KangLin.RabbitRemoteControl.desktop
cp ${{github.workspace}}/build_appimage/AppDir/usr/share/icons/hicolor/scalable/apps/io.github.KangLin.RabbitRemoteControl.svg io.github.KangLin.RabbitRemoteControl.svg
cp ${{github.workspace}}/Script/install_appimage.sh install.sh
chmod a+x install.sh
popd
zip RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup/*
md5sum RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage > RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage.md5sum
MD5SUM=`cat RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage.md5sum|awk '{print $1}'`
echo "MD5SUM RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage: ${MD5SUM}"
echo "Generate update configure file ......"
./RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage \
-f "${{github.workspace}}/update_appimage_${{matrix.os}}_qt${{matrix.qt_version}}.json" \
--foc 1 \
--file-name RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage \
-u "https://github.com/KangLin/RabbitRemoteControl/releases/download/v${{env.RabbitRemoteControl_VERSION}}/RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage;https://master.dl.sourceforge.net/project/rabbitremotecontrol/v${{env.RabbitRemoteControl_VERSION}}/RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage?viasf=1" \
--md5 "${MD5SUM}"
- name: Update artifact
if: ${{ matrix.BUILD_TYPE == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}_${{matrix.os}}_${{matrix.PACKAGE}}
path: |
#${{github.workspace}}/RabbitRemoteControl_*.AppImage
${{github.workspace}}/RabbitRemoteControl_*.zip
${{github.workspace}}/rabbitremotecontrol_*.deb
${{github.workspace}}/update_*.json
${{github.workspace}}/version.json
${{github.workspace}}/update_linux.xml