Skip to content

fix(maa): 优化默认参数;兼容脚本重启 #4

fix(maa): 优化默认参数;兼容脚本重启

fix(maa): 优化默认参数;兼容脚本重启 #4

Workflow file for this run

name: Release Build
# 推送 v* tag 时自动打包并发布正式 release;手动 workflow_dispatch 仅做构建+exe 集成测试(调试用,不发布)。
# 版本号即 tag 名(如 v0.0.1),发新版时打新 tag 即「每次递增」。
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write # 创建 release 与 tag 需要写权限
jobs:
release:
runs-on: windows-latest
env:
PYTHONUTF8: 1 # 与 build-exe.yml 同源:冻结 exe 在英文 locale 下经 colorama 输出中文不崩
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v5
# 复用 build-exe.yml 的构建链路:打包 GUI(onedir)+Runner(onefile) 并跑 exe 集成测试。
# exe 测试失败则 build.bat 非 0 退出,本步骤失败 ⇒ 不发布。
- name: Build EXE and run exe integration tests
shell: cmd
run: call deploy\build.bat
- name: Package dist into zip
shell: pwsh
run: Compress-Archive -Path deploy/dist/OneDragon-Helper -DestinationPath OneDragon-Helper.zip
# 仅 tag 触发时发布正式 release(手动 dispatch 跳过,避免用分支名造出错误 release)。
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="${GITHUB_REF_NAME}" # 形如 v0.0.1
notes=$(printf '%s\n\n%s' "自动构建发布 $version(对应 commit: $GITHUB_SHA)" "下载 OneDragon-Helper.zip 解压后即可使用。")
gh release create "$version" \
--target "$GITHUB_SHA" \
--title "$version" \
--notes "$notes" \
OneDragon-Helper.zip