diff --git a/.github/workflows/python-app.yml b/.github/workflows/build-app.yml similarity index 99% rename from .github/workflows/python-app.yml rename to .github/workflows/build-app.yml index 28912d4..8b14e97 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/build-app.yml @@ -22,7 +22,7 @@ name: Build AUTO_MAA on: push: - branches: [ "main","dev" ] + branches: [ "main" ] paths-ignore: - '**.md' - 'LICENSE' diff --git a/.github/workflows/build-pre.yml b/.github/workflows/build-pre.yml new file mode 100644 index 0000000..a8c7dbb --- /dev/null +++ b/.github/workflows/build-pre.yml @@ -0,0 +1,158 @@ +# +# Copyright © <2024> + +# 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 . + +# DLmaster_361@163.com + +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

$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

$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 }} \ No newline at end of file diff --git a/resources/audio/3星结束行动.wav b/resources/audio/3星结束行动.wav deleted file mode 100644 index 1769d44..0000000 Binary files a/resources/audio/3星结束行动.wav and /dev/null differ diff --git a/resources/audio/交谈1.wav b/resources/audio/交谈1.wav deleted file mode 100644 index 93fdef6..0000000 Binary files a/resources/audio/交谈1.wav and /dev/null differ diff --git a/resources/audio/交谈2.wav b/resources/audio/交谈2.wav deleted file mode 100644 index d22984f..0000000 Binary files a/resources/audio/交谈2.wav and /dev/null differ diff --git a/resources/audio/交谈3.wav b/resources/audio/交谈3.wav deleted file mode 100644 index 461a5e0..0000000 Binary files a/resources/audio/交谈3.wav and /dev/null differ diff --git a/resources/audio/任命助理.wav b/resources/audio/任命助理.wav deleted file mode 100644 index 1e80f09..0000000 Binary files a/resources/audio/任命助理.wav and /dev/null differ diff --git a/resources/audio/任命队长.wav b/resources/audio/任命队长.wav deleted file mode 100644 index 3f7765c..0000000 Binary files a/resources/audio/任命队长.wav and /dev/null differ diff --git a/resources/audio/作战中1.wav b/resources/audio/作战中1.wav deleted file mode 100644 index 178c862..0000000 Binary files a/resources/audio/作战中1.wav and /dev/null differ diff --git a/resources/audio/作战中2.wav b/resources/audio/作战中2.wav deleted file mode 100644 index a68eef9..0000000 Binary files a/resources/audio/作战中2.wav and /dev/null differ diff --git a/resources/audio/作战中3.wav b/resources/audio/作战中3.wav deleted file mode 100644 index 3dab79a..0000000 Binary files a/resources/audio/作战中3.wav and /dev/null differ diff --git a/resources/audio/作战中4.wav b/resources/audio/作战中4.wav deleted file mode 100644 index 172612e..0000000 Binary files a/resources/audio/作战中4.wav and /dev/null differ diff --git a/resources/audio/信赖提升后交谈1.wav b/resources/audio/信赖提升后交谈1.wav deleted file mode 100644 index 4bb56cb..0000000 Binary files a/resources/audio/信赖提升后交谈1.wav and /dev/null differ diff --git a/resources/audio/信赖提升后交谈2.wav b/resources/audio/信赖提升后交谈2.wav deleted file mode 100644 index aefc75d..0000000 Binary files a/resources/audio/信赖提升后交谈2.wav and /dev/null differ diff --git a/resources/audio/信赖提升后交谈3.wav b/resources/audio/信赖提升后交谈3.wav deleted file mode 100644 index dbab117..0000000 Binary files a/resources/audio/信赖提升后交谈3.wav and /dev/null differ diff --git a/resources/audio/信赖触摸.wav b/resources/audio/信赖触摸.wav deleted file mode 100644 index 80c6717..0000000 Binary files a/resources/audio/信赖触摸.wav and /dev/null differ diff --git a/resources/audio/周年庆典.wav b/resources/audio/周年庆典.wav deleted file mode 100644 index 6380ff9..0000000 Binary files a/resources/audio/周年庆典.wav and /dev/null differ diff --git a/resources/audio/完成高难行动.wav b/resources/audio/完成高难行动.wav deleted file mode 100644 index 75007d7..0000000 Binary files a/resources/audio/完成高难行动.wav and /dev/null differ diff --git a/resources/audio/干员报到.wav b/resources/audio/干员报到.wav deleted file mode 100644 index a6057f5..0000000 Binary files a/resources/audio/干员报到.wav and /dev/null differ diff --git a/resources/audio/戳一下.wav b/resources/audio/戳一下.wav deleted file mode 100644 index f24790e..0000000 Binary files a/resources/audio/戳一下.wav and /dev/null differ diff --git a/resources/audio/新年祝福.wav b/resources/audio/新年祝福.wav deleted file mode 100644 index 6adafc6..0000000 Binary files a/resources/audio/新年祝福.wav and /dev/null differ diff --git a/resources/audio/晋升后交谈1.wav b/resources/audio/晋升后交谈1.wav deleted file mode 100644 index 05aa36f..0000000 Binary files a/resources/audio/晋升后交谈1.wav and /dev/null differ diff --git a/resources/audio/晋升后交谈2.wav b/resources/audio/晋升后交谈2.wav deleted file mode 100644 index a29ace0..0000000 Binary files a/resources/audio/晋升后交谈2.wav and /dev/null differ diff --git a/resources/audio/标题.wav b/resources/audio/标题.wav deleted file mode 100644 index e392c40..0000000 Binary files a/resources/audio/标题.wav and /dev/null differ diff --git a/resources/audio/生日.wav b/resources/audio/生日.wav deleted file mode 100644 index 6239884..0000000 Binary files a/resources/audio/生日.wav and /dev/null differ diff --git a/resources/audio/精英化晋升1.wav b/resources/audio/精英化晋升1.wav deleted file mode 100644 index 7bcc14e..0000000 Binary files a/resources/audio/精英化晋升1.wav and /dev/null differ diff --git a/resources/audio/精英化晋升2.wav b/resources/audio/精英化晋升2.wav deleted file mode 100644 index c9d135b..0000000 Binary files a/resources/audio/精英化晋升2.wav and /dev/null differ diff --git a/resources/audio/编入队伍.wav b/resources/audio/编入队伍.wav deleted file mode 100644 index 37abd01..0000000 Binary files a/resources/audio/编入队伍.wav and /dev/null differ diff --git a/resources/audio/行动出发.wav b/resources/audio/行动出发.wav deleted file mode 100644 index 24d326a..0000000 Binary files a/resources/audio/行动出发.wav and /dev/null differ diff --git a/resources/audio/行动失败.wav b/resources/audio/行动失败.wav deleted file mode 100644 index 31a7666..0000000 Binary files a/resources/audio/行动失败.wav and /dev/null differ diff --git a/resources/audio/行动开始.wav b/resources/audio/行动开始.wav deleted file mode 100644 index 9857957..0000000 Binary files a/resources/audio/行动开始.wav and /dev/null differ diff --git a/resources/audio/观看作战记录.wav b/resources/audio/观看作战记录.wav deleted file mode 100644 index 16ddf2d..0000000 Binary files a/resources/audio/观看作战记录.wav and /dev/null differ diff --git a/resources/audio/进驻设施.wav b/resources/audio/进驻设施.wav deleted file mode 100644 index 689f7b4..0000000 Binary files a/resources/audio/进驻设施.wav and /dev/null differ diff --git a/resources/audio/选中干员1.wav b/resources/audio/选中干员1.wav deleted file mode 100644 index 91191d0..0000000 Binary files a/resources/audio/选中干员1.wav and /dev/null differ diff --git a/resources/audio/选中干员2.wav b/resources/audio/选中干员2.wav deleted file mode 100644 index 4b9cfa9..0000000 Binary files a/resources/audio/选中干员2.wav and /dev/null differ diff --git a/resources/audio/部署1.wav b/resources/audio/部署1.wav deleted file mode 100644 index d6f11b1..0000000 Binary files a/resources/audio/部署1.wav and /dev/null differ diff --git a/resources/audio/部署2.wav b/resources/audio/部署2.wav deleted file mode 100644 index da427ae..0000000 Binary files a/resources/audio/部署2.wav and /dev/null differ diff --git a/resources/audio/问候.wav b/resources/audio/问候.wav deleted file mode 100644 index b4eec06..0000000 Binary files a/resources/audio/问候.wav and /dev/null differ diff --git a/resources/audio/闲置.wav b/resources/audio/闲置.wav deleted file mode 100644 index be0f142..0000000 Binary files a/resources/audio/闲置.wav and /dev/null differ diff --git a/resources/audio/非3星结束行动.wav b/resources/audio/非3星结束行动.wav deleted file mode 100644 index 2b765ab..0000000 Binary files a/resources/audio/非3星结束行动.wav and /dev/null differ