-
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (42 loc) · 1.29 KB
/
python-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: 发布眼迹AI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检出仓库
uses: actions/checkout@v2
- name: 设置Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: 创建和激活Python虚拟环境
run: python3 -m venv venv && source venv/bin/activate
- name: 安装系统依赖项
run: |
sudo apt update
sudo apt install -y pkg-config libssl-dev libffi-dev
- name: 安装依赖项
run: |
python3 -m pip install --upgrade pip
pip3 install numpy opencv-python aiohttp==3.8.1 cchardet==2.1.7
pip3 install -r requirements.txt
- name: 构建二进制文件
run: pyinstaller --onefile run.py
- name: 读取Changelog
id: read_changelog
run: echo "CHANGELOG_CONTENT<<EOF" >> $GITHUB_ENV && cat CHANGELOG.md >> $GITHUB_ENV && echo "EOF" >> $GITHUB_ENV
- name: 创建发布
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
body: ${{ env.CHANGELOG_CONTENT }}
draft: false
prerelease: false