diff --git a/.github/workflows/build-executables.yml b/.github/workflows/build-executables.yml index cc16aca..28b9442 100644 --- a/.github/workflows/build-executables.yml +++ b/.github/workflows/build-executables.yml @@ -2,12 +2,16 @@ name: Build PyInstaller Bundles on: workflow_dispatch: - push: - branches: - - main - pull_request: - branches: - - main + inputs: + tag: + description: "Release tag (for example v1.0.0)" + required: true + name: + description: "Release title (defaults to tag when omitted)" + required: false + notes: + description: "Release notes (supports Markdown)" + required: false jobs: package: @@ -55,9 +59,39 @@ jobs: working-directory: backend run: pyinstaller main.spec --clean - - name: Archive bundle + - name: Package bundle + run: | + python - <<'PY' +import pathlib +import shutil + +archive = pathlib.Path(f"Easy-BabelDOC-${{ matrix.os }}") +shutil.make_archive(str(archive), "zip", "backend/dist") +PY + + - name: Upload archive uses: actions/upload-artifact@v4 with: name: Easy-BabelDOC-${{ matrix.os }} - path: | - backend/dist/** + path: Easy-BabelDOC-${{ matrix.os }}.zip + + release: + name: Publish Release + needs: package + runs-on: ubuntu-latest + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: List downloaded files + run: ls -R artifacts + + - name: Publish GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.inputs.tag }} + name: ${{ github.event.inputs.name || github.event.inputs.tag }} + body: ${{ github.event.inputs.notes }} + files: artifacts/**/* diff --git a/docs/windows-exe-deployment.md b/docs/windows-exe-deployment.md index 96965f5..5ea7821 100644 --- a/docs/windows-exe-deployment.md +++ b/docs/windows-exe-deployment.md @@ -86,6 +86,7 @@ - `Easy-BabelDOC.exe` - `README_RUN_FIRST.txt`(说明默认端口、如何修改配置、常见问题)。 - 可选:在首次运行时弹出提示(控制台或简单 GUI),介绍使用方式。 +- GitHub 仓库可通过 **Build PyInstaller Bundles** 工作流手动触发三平台构建:提交 release tag / 标题 / 说明后,流水线会自动上传三个系统的压缩包并创建 Release。 - 如需在线更新,可考虑: - 提供版本号接口,让应用在启动时检查更新。 - 使用第三方更新器(例如 WinSparkle)或手动引导用户重新下载。