-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (106 loc) · 3.27 KB
/
python-build.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Build and Release Python Application
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
windows-build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry pyinstaller
poetry install
poetry run python -m pip install pyinstaller
- name: Install Windows build tools
run: |
choco install -y vcredist2010 vcredist2013 vcredist140
- name: Build with PyInstaller
run: |
poetry run pyinstaller -F actuator/__main__.py `
--icon logo.ico `
--name "actuator-${{ github.ref_name }}-windows-amd64" `
--collect-all paddleocr `
--collect-all pyclipper `
--collect-all imghdr `
--collect-all skimage `
--collect-all imgaug `
--collect-all scipy.io `
--collect-all lmdb `
--collect-all paddle `
--collect-all lupa
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: windows-executable
path: dist/actuator-${{ github.ref_name }}-windows-amd64.exe
linux-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
poetry run python -m pip install pyinstaller
- name: Build Executable
run: |
poetry run pyinstaller -F actuator/__main__.py \
--name "actuator-${{ github.ref_name }}-linux-amd64" \
--collect-all paddleocr \
--collect-all pyclipper \
--collect-all imghdr \
--collect-all skimage \
--collect-all imgaug \
--collect-all scipy.io \
--collect-all lmdb \
--collect-all paddle \
--collect-all lupa
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: linux-executable
path: dist/actuator-${{ github.ref_name }}-linux-amd64
create-release:
name: Create Unified Release
needs: [windows-build, linux-build]
runs-on: ubuntu-latest
steps:
- name: Download Windows Artifact
uses: actions/download-artifact@v4
with:
name: windows-executable
- name: Download Linux Artifact
uses: actions/download-artifact@v4
with:
name: linux-executable
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: "Release ${{ github.ref_name }}"
body: |
Multi-platform build includes:
- Windows Executable (.exe)
- Linux Binary
files: |
actuator-${{ github.ref_name }}-windows-amd64.exe
actuator-${{ github.ref_name }}-linux-amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}