Skip to content

新增连续采集功能 #59

新增连续采集功能

新增连续采集功能 #59

Workflow file for this run

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@v6
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@v4
with:
submodules: recursive
- name: 读入环境信息
run: |
echo "version=${{ env.version }}"
- name: 编译环境设置
uses: actions/setup-python@v5
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@v4
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@v4
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: "./*.exe" # 确保路径指向下载的文件