Add email service with Flask API endpoints for managing email account… #13
Workflow file for this run
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: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # 触发条件:推送以v开头的tag | |
| jobs: | |
| build: | |
| runs-on: windows-latest # 使用Windows最新版本作为运行环境 | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v3 | |
| - name: 设置Python环境 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12.x' # 锁定Python 3.12.x版本 | |
| cache: 'pip' # 缓存pip依赖以加速构建 | |
| - name: 安装依赖 | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: 打包应用 | |
| run: | | |
| # 使用PowerShell脚本打包应用 | |
| # 注意:输出文件会被放置在项目根目录的dist文件夹中 | |
| .\scripts\build_exe.ps1 -SkipInstall -OutputName emailAPI.exe | |
| shell: pwsh | |
| - name: 获取版本号 | |
| id: get_version | |
| run: | | |
| # 从tag中提取版本号(去掉v前缀) | |
| $VERSION = "${{ github.ref }}".Replace('refs/tags/v', '') | |
| echo "VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| shell: pwsh | |
| - name: 创建Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Release v${{ env.VERSION }} | |
| draft: false | |
| prerelease: false | |
| body: | | |
| Email应用 v${{ env.VERSION }} 发布 | |
| ### 更新内容 | |
| - 自动构建的Release | |
| ### 安装说明 | |
| 1. 下载 emailAPI.exe | |
| 2. 双击运行 | |
| ### 自动更新 | |
| 应用会在启动时自动检查更新并下载安装新版本 | |
| files: | | |
| # dist目录位于项目根目录,不是scripts目录 | |
| dist/emailAPI.exe | |
| dist/emailAPI.exe.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |