- 重构 IdentificationTests.py 中的模板匹配逻辑 #48
This file contains 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: 发布应用 | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: write | |
actions: write | |
jobs: | |
jobs_version: | |
name: 构建版本号和变更信息 | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.create_version.outputs.tag_name }} | |
body: ${{ steps.create_version.outputs.body }} | |
steps: | |
- uses: release-drafter/release-drafter@v5 | |
id: create_version | |
with: | |
config-name: release-drafter.yml | |
disable-autolabeler: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 查看变量 | |
run: | | |
echo "version=${{ steps.create_version.outputs.tag_name }}" | |
jobs_windows: | |
needs: jobs_version | |
name: 构建EXE | |
runs-on: windows-2022 | |
env: | |
version: ${{ needs.jobs_version.outputs.version }} | |
body: ${{ needs.jobs_version.outputs.body }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: 读入环境信息 | |
run: | | |
echo "version=${{ env.version }}" | |
- name: 编译环境设置 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.2" | |
architecture: "x64" | |
cache: 'pip' | |
- name: 下载依赖文件 | |
run: pip install -r requirements.txt | |
- name: 编译exe | |
run: | | |
python -m pip install --upgrade pip | |
pyinstaller main-win.spec | |
- name: 查看dist目录 | |
run: | | |
ls ./dist # 列出生成文件,确保文件存在 | |
- name: 上传产物 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-artifact | |
path: ./dist/*.exe # 确保上传的路径正确 | |
jobs4: | |
needs: [ jobs_version, jobs_windows ] | |
name: 发布版本 | |
runs-on: ubuntu-latest | |
env: | |
version: ${{ needs.jobs_version.outputs.version }} | |
body: ${{ needs.jobs_version.outputs.body }} | |
steps: | |
- name: 下载 | |
id: download | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-artifact | |
path: ./ # 确保下载到根目录 | |
- name: 读入环境信息 | |
run: | | |
echo "version=${{ env.version }}" | |
echo "download path: ${{ steps.download.outputs.download-path }}" | |
ls -R # 列出所有文件,确认下载成功 | |
- name: 发布文件 | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
#prerelease: true # 预发布 别人可以看到 版本号会继续加 | |
tag: ${{ env.version }} | |
body: ${{ env.body }} | |
artifacts: "windows/*.exe" # 确保路径指向下载的文件 |