Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DLmaster361 committed Jan 28, 2025
2 parents 764d0af + 8c1c3c5 commit 37502b6
Show file tree
Hide file tree
Showing 31 changed files with 5,986 additions and 4,098 deletions.
File renamed without changes.
158 changes: 158 additions & 0 deletions .github/workflows/build-pre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
# Copyright © <2024> <DLmaster361>

# This file is part of AUTO_MAA.

# AUTO_MAA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.

# AUTO_MAA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.

# [email protected]

name: Build AUTO_MAA_Pre

on:
push:
branches: [ "dev" ]
paths-ignore:
- '**.md'
- 'LICENSE'
pull_request:
branches: [ "dev" ]
paths-ignore:
- '**.md'
- 'LICENSE'

permissions:
contents: read

jobs:
pre_check:
name: Pre Checks
runs-on: ubuntu-latest
steps:
- name: Repo Check
id: repo_check
run: |
if [[ "$GITHUB_REPOSITORY" != "DLmaster361/AUTO_MAA" ]]; then
echo "When forking this repository to make your own builds, you have to adjust this check."
exit 1
fi
exit 0
build_AUTO_MAA:
runs-on: windows-latest
needs: pre_check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Package
id: package
run: |
copy app\utils\package.py .\
python package.py
- name: Read version
id: read_version
run: |
$MAIN_VERSION=(Get-Content -Path "version_info.txt" -TotalCount 1).Trim()
"AUTO_MAA_version=$MAIN_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
$UPDATER_VERSION=(Get-Content -Path "version_info.txt" -TotalCount 2 | Select-Object -Index 1).Trim()
"updater_version=$UPDATER_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Create Zip
id: create_zip
run: |
Compress-Archive -Path app,resources,main.py,AUTO_MAA.exe,requirements.txt,README.md,LICENSE -DestinationPath AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
Compress-Archive -Path Updater.exe -DestinationPath Updater_${{ env.updater_version }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: AUTO_MAA_${{ env.AUTO_MAA_version }}
path: |
AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
Updater_${{ env.updater_version }}.zip
- name: Upload Version_Info Artifact
uses: actions/upload-artifact@v4
with:
name: version_info
path: version_info.txt
publish_prerelease:
name: Publish prerelease
needs: build_AUTO_MAA
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: AUTO_MAA_*
merge-multiple: true
path: artifacts
- name: Download Version_Info
uses: actions/download-artifact@v4
with:
name: version_info
path: ./
- name: Check if release exists
id: check_if_release_exists
run: |
release_id=$(gh release view $(sed 's/\r$//g' <(head -n 1 version_info.txt)) --json id --jq .id || true)
if [[ -z $release_id ]]; then
echo "release_exists=false" >> $GITHUB_OUTPUT
else
echo "release_exists=true" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Create prerelease
id: create_prerelease
if: steps.check_if_release_exists.outputs.release_exists == 'false'
run: |
set -xe
shopt -s nullglob
NAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
TAGNAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 version_info.txt))"
NOTES_TAIL="\`\`\`本release通过GitHub Actions自动构建\`\`\`"
NOTES="$NOTES_MAIN<br><br>$NOTES_TAIL"
gh release create "$TAGNAME" --target "main" --title "$NAME" --notes "$NOTES" --prerelease artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
- name: Update prerelease
id: update_prerelease
if: steps.check_if_release_exists.outputs.release_exists == 'true'
run: |
set -xe
shopt -s nullglob
NAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
TAGNAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 version_info.txt))"
NOTES_TAIL="\`\`\`本release通过GitHub Actions自动构建\`\`\`"
NOTES="$NOTES_MAIN<br><br>$NOTES_TAIL"
gh release delete "$TAGNAME" --yes
gh release create "$TAGNAME" --target "main" --title "$NAME" --notes "$NOTES" --prerelease artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ MAA多账号管理与自动化软件

1. **配置:** 根据对应用户的配置信息,生成配置文件并将其导入MAA。
2. **监测:** 在MAA开始代理后,持续读取MAA的日志以判断其运行状态。当软件认定MAA出现异常时,通过重启MAA使之仍能继续完成任务。
3. **循环:** 重复上述步骤,使MAA依次完成各个用户的日常代理任务
3. **循环:** 重复上述步骤,使MAA依次完成各个用户的自动代理任务

### 优势

- **节省运行开销:** 只需要一份MAA软件与一个模拟器,无需多开就能完成多账号代理,羸弱的电脑也能代理日常。
- **自定义空间大:** 依靠高级用户配置模式,支持MAA几乎所有设置选项自定义,同时保留对模拟器多开的支持。
- **一键代理无忧:** 无须中途手动修改MAA配置,将繁琐交给AUTO_MAA,把游戏留给自己。
- **代理结果复核:** 通过人工排查功能核实各用户代理情况,堵住日常代理的最后一丝风险
- **代理结果复核:** 通过人工排查功能核实各用户代理情况,堵住自动代理的最后一丝风险

## 重要声明

Expand Down Expand Up @@ -127,8 +127,8 @@ MAA多账号管理与自动化软件
- `MAA路径`:该项无法直接编辑,仅用于展示当前程序所绑定MAA的路径。
- `浏览`:选择MAA文件夹。
- `设置MAA`:编辑MAA全局配置,具体使用方法参见前文。
- `日常限制`执行日常代理的日常部分时的超时阈值,当MAA日志无变化时间超过阈值时,视为超时。
- `剿灭限制`执行日常代理的剿灭部分时的超时阈值,当MAA日志无变化时间超过阈值时,视为超时。
- `日常限制`执行自动代理的日常部分时的超时阈值,当MAA日志无变化时间超过阈值时,视为超时。
- `剿灭限制`执行自动代理的剿灭部分时的超时阈值,当MAA日志无变化时间超过阈值时,视为超时。
- `运行失败重试次数上限`:对于每一用户,若超过该次数限制仍未完成代理,视为代理失败。
- `开机自动启动AUTO_MAA`:实现AUTO_MAA的自启动。
- `AUTO_MAA启动时禁止电脑休眠`:仅阻止电脑自动休眠,不会影响屏幕是否熄灭。
Expand All @@ -154,8 +154,8 @@ MAA多账号管理与自动化软件
- `状态`:用户的状态,禁用时将不再对其进行代理或排查。
- `执行情况`:当日执行情况,不可编辑。
- `关卡``备选关卡-1``备选关卡-2`:关卡号。
- `日常`单独设定是否进行日常代理的日常部分,可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
- `剿灭`单独设定是否进行日常代理的剿灭部分,高级配置模式下可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
- `日常`单独设定是否进行自动代理的日常部分,可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
- `剿灭`单独设定是否进行自动代理的剿灭部分,高级配置模式下可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
- `自定义基建`:是否启用自定义基建功能,需要进一步配置自定义基建文件,该配置与其他用户相互独立。
- `密码`:仅用于登记用户的密码,可留空。
- `备注`:用于备注用户信息。
Expand Down
17 changes: 11 additions & 6 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,23 @@
__author__ = "DLmaster361 <[email protected]>"
__license__ = "GPL-3.0 license"

from .config import AppConfig
from .core import AppConfig, QueueConfig, MaaConfig, Task, Task_manager, Main_timer
from .models import MaaManager
from .services import Notification, CryptoHandler
from .services import Notify, Crypto, System
from .ui import AUTO_MAA
from .utils import Updater, version_text
from .utils import Updater

__all__ = [
"AppConfig",
"QueueConfig",
"MaaConfig",
"Task",
"Task_manager",
"Main_timer",
"MaaManager",
"Notification",
"CryptoHandler",
"Notify",
"Crypto",
"System",
"AUTO_MAA",
"Updater",
"version_text",
]
Loading

0 comments on commit 37502b6

Please sign in to comment.