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 -k - 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 -k - 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