forked from Mzdyl/LiteLoaderQQNT_Install
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (115 loc) · 3.89 KB
/
unix.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: macOS and Linux
on:
push:
paths:
- 'install.sh'
- '.github/workflows/unix.yml'
pull_request:
paths:
- 'install.sh'
- '.github/workflows/unix.yml'
workflow_dispatch:
jobs:
install_and_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9 # 指定 Python 3 版本
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get install -f
sudo apt-get install -y xvfb libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libatspi2.0-0 libuuid1 libsecret-1-0
fi
- name: Download and Install QQ Software
run: |
echo "当前 RUNNER_OS: $RUNNER_OS"
if [[ "$RUNNER_OS" == "Linux" ]]; then
python3 get_qqnt.py Debianx64
sudo dpkg -i LinuxQQ.deb
elif [[ "$RUNNER_OS" == "macOS" ]]; then
python3 get_qqnt.py Macos
hdiutil attach QQ.dmg
cp -R /Volumes/QQ/QQ.app /Applications
hdiutil detach /Volumes/QQ
open /Applications/QQ.app/ & # 运行 QQ 以创建沙盒内文件夹
fi
- name: Run install.sh
run: |
chmod +x install.sh
./install.sh
- name: Check LiteLoaderQQNT
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
xvfb-run /opt/QQ/qq --logging-enable | tee output.log &
APP_PID=$!
sleep 3
kill -9 $APP_PID
# 检查数据目录是否存在
if grep -q '^\[LiteLoader\]' output.log || [ -d "$HOME/.config/LiteLoaderQQNT/data" ]; then
echo "LiteLoaderQQNT 测试成功"
else
echo "LiteLoaderQQNT 测试失败,放行"
# exit 1
fi
elif [[ "$RUNNER_OS" == "macOS" ]]; then
/Applications/QQ.app/Contents/MacOS/QQ & # 启动 QQ,放入后台
sleep 3 # 等待 3 秒
pkill QQ # 关闭 QQ 应用程序
if [ -d "$HOME/Library/Containers/com.tencent.qq/Data/Documents/LiteLoaderQQNT/data" ]; then
echo "LiteLoaderQQNT data folder exists. Test succeeded."
else
echo "LiteLoaderQQNT data folder does not exist. Test failed."
exit 1
fi
fi
- name: Set up iptables rules
if: runner.os == 'Linux'
run: |
sudo iptables -A OUTPUT -d github.com -j REJECT
- name: ReRun install.sh
run: |
./install.sh
check_flatpak_qq:
runs-on: ubuntu-latest # 使用 Ubuntu 运行 Flatpak 版本测试
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Flatpak
run: |
sudo apt-get install -y xvfb # 虚拟显示
sudo apt-get update
sudo apt-get install -y flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Install Flatpak QQ
run: |
sudo flatpak install -y flathub com.qq.QQ
- name: Run install.sh
run: |
chmod +x install.sh
./install.sh
- name: Check LiteLoaderQQNT
run: |
sudo flatpak override --filesystem=home com.qq.QQ
# 启动应用并获取进程 ID
xvfb-run flatpak run com.qq.QQ --logging-enable | tee output.log &
APP_PID=$!
sleep 3
kill -9 $APP_PID
# 检查数据目录是否存在
if grep -q '^\[LiteLoader\]' output.log || [ -d "$HOME/.config/LiteLoaderQQNT/data" ]; then
echo "Flatpak 版 QQ LiteLoaderQQNT 测试成功"
else
echo "Flatpak 版 QQ LiteLoaderQQNT 测试失败,放行"
# exit 1
fi