forked from Mzdyl/LiteLoaderQQNT_Install
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (79 loc) · 2.8 KB
/
macOS.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
name: macOS
on:
push:
paths:
- 'install.sh'
- '.github/workflows/macOS.yml'
pull_request:
paths:
- 'install.sh'
- '.github/workflows/macOS.yml'
workflow_dispatch:
jobs:
check_macos_qq:
runs-on: 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
- name: Download and Install QQ Software
run: |
python3 get_qqnt.py Macos
hdiutil attach QQ.dmg
cp -R /Volumes/QQ/QQ.app /Applications
hdiutil detach /Volumes/QQ
open /Applications/QQ.app/ &
- name: Run install.sh
run: |
chmod +x install.sh
./install.sh
- name: Run QQ on macOS, wait, and check LiteLoaderQQNT
run: |
/Applications/QQ.app/Contents/MacOS/QQ & # 启动 QQ,放入后台
sleep 3 # 等待 3 秒
# 关闭 QQ 应用程序,这里使用 pkill 假设 QQ 进程的名字为 QQ
pkill QQ
# 检查 LiteLoaderQQNT 插件是否存在
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
- name: Set up iptables rules
run: |
# 阻止访问 GitHub
echo "127.0.0.1 github.com" | sudo tee -a /etc/hosts
echo "127.0.0.1 api.github.com" | sudo tee -a /etc/hosts
- name: Remove LiteLoaderQQNT directory
run: |
if [ -d "$HOME/Library/Containers/com.tencent.qq/Data/Documents/LiteLoaderQQNT" ]; then
# 删除目录及其内容
rm -rf "$HOME/Library/Containers/com.tencent.qq/Data/Documents/LiteLoaderQQNT"
echo "LiteLoaderQQNT directory removed successfully."
else
echo "LiteLoaderQQNT directory does not exist."
fi
- name: ReRun install.sh
run: |
./install.sh
- name: Check LiteLoader
run: |
/Applications/QQ.app/Contents/MacOS/QQ & # 启动 QQ,放入后台
sleep 3 # 等待 3 秒
# 关闭 QQ 应用程序,这里使用 pkill 假设 QQ 进程的名字为 QQ
pkill QQ
# 检查 LiteLoaderQQNT 插件是否存在
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