增加启动bat,隐藏exe的控制台,删除遗留lua #448
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI and Release | |
| # 触发条件:任何推送(包括分支和标签) | |
| on: [push] | |
| jobs: | |
| build-and-maybe-release: | |
| runs-on: windows-latest | |
| # 设置必要的权限,用于创建 Release | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # 获取完整历史,确保标签对象被下载 | |
| # 配置 CMake(强制 UTF-8 编码) | |
| - name: Configure CMake | |
| run: cmake -B build -A x64 -DCMAKE_CXX_FLAGS="/utf-8" | |
| # 构建 Release 版本 | |
| - name: Build | |
| run: cmake --build build --config Release --parallel | |
| # 运行 Python 打包脚本 | |
| - name: Run Python helper scripts | |
| run: | | |
| python bin/Pack.py | |
| continue-on-error: true | |
| # 上传构建产物到 GitHub Actions 的 Artifacts(无论前一步是否成功) | |
| - name: Upload artifacts (always) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-outputs-${{ github.sha }} | |
| path: | | |
| bin/Output/ | |
| bin/MulNX.zip | |
| bin/MulNX/ | |
| if-no-files-found: warn | |
| # 如果是标签推送,先提取标签消息并写入文件 | |
| - name: Get tag message | |
| if: github.ref_type == 'tag' | |
| shell: bash | |
| run: | | |
| # 读取注解标签的消息内容(标签名加引号,防止特殊字符) | |
| MSG=$(git tag -l --format='%(contents)' "${{ github.ref_name }}") | |
| # 如果消息为空(轻量标签),使用默认说明 | |
| if [ -z "$MSG" ]; then | |
| MSG="自动构建的 Release,版本:${{ github.ref_name }}" | |
| fi | |
| # 将消息写入文件,后续通过 body_path 安全传递给 Release 步骤 | |
| printf '%s\n' "$MSG" > tag_body.txt | |
| # 如果是标签推送,则创建 GitHub Release 并上传文件 | |
| - name: Create GitHub Release (only for tags) | |
| if: github.ref_type == 'tag' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| # 使用标签名作为 Release 标题 | |
| name: Release ${{ github.ref_name }} | |
| # 从文件读取 Release 说明,避免多行文本的特殊字符问题 | |
| body_path: tag_body.txt | |
| # 要上传的文件列表(支持通配符) | |
| files: | | |
| bin/MulNX.zip | |
| # 是否为预发布版本(根据需要调整) | |
| prerelease: false | |
| # 是否为草稿 | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |