-
Notifications
You must be signed in to change notification settings - Fork 1
194 lines (186 loc) · 7.55 KB
/
python-release.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: 箱号识别服务发布
on:
push:
tags:
- conta_ocrV*
jobs:
release:
name: 箱号识别服务发布
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest"
steps:
- name: 克隆代码
uses: actions/checkout@v3
- name: 创建发行版本
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: README.md
draft: false
prerelease: false
amd64_job:
name: ${{ matrix.device_type }}箱号识别服务打包
container:
image: jadehh/container_ocr:amd64-packing-1.0.1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest"
device_type: ["Paddle","Amd64"]
steps:
- name: 下载代码
uses: actions/checkout@v3
with:
repository: jadehh/ContainerOCR
ref: conta_ocr
path: code
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
- name: 安装pip环境
run: pip install -r code/requirements.txt
- name: Paddle打包编译
if: ${{ matrix.device_type=='Paddle'}}
run: |
cd code
pip install -r requirements/Paddle/requirements.txt
python packing_app.py \
--head_str "import sys\nsys.path.append('/usr/local/conta_detect-1.0/python_lib')\nimport paddle\n" \
--is_exec True
- name: Amd64打包编译
if: ${{ matrix.device_type=='Amd64'}}
run: |
cd code
pip install -r requirements/Amd64/requirements.txt
python packing_app.py \
--head_str "import sys\nsys.path.append('/usr/local/site-packages/')\nimport paddle\n" \
--name 箱号识别服务Amd64 \
--app_name conta_ocr_amd64 \
--lib_path conta_ocr_amd64_lib64 \
--is_exec True
- name: 发布
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files:
"./code/Output/*"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # 给最高的权限
Py38:
name: ${{ matrix.device_type }}箱号识别服务打包
container:
image: jadehh/python:3.8.16-ubuntu18.04
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest"
device_type: [ "ONNX" ]
steps:
- name: 下载代码
uses: actions/checkout@v3
with:
repository: jadehh/ContainerOCR
ref: conta_ocr
path: code
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
- name: 安装pip环境
run: |
pip install -r code/requirements.txt
pip uninstall -y numpy
- name: ONNX打包编译
run: |
cd code
pip install -r requirements/ONNX/requirements.txt
python packing_app.py \
--extra_sys_str /usr/local/site-packages,/usr/local/opencv \
--app_name local_conta_ocr_onnx \
--lib_path local_conta_ocr_x86_lib64 \
--is_exec True
- name: 发布
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files:
"./code/Output/*"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # 给最高的权限
aarch64_job:
# The host should always be Linux
name: ${{ matrix.device_type }}箱号识别服务打包
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest"
#device_type: ["RKNN","Ascend"]
device_type: ["RKNN","Ascend"]
steps:
- name: 下载代码
uses: actions/checkout@v3
with:
repository: jadehh/ContainerOCR
ref: conta_ocr
path: code
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
- name: RKNN打包环境准备
if: ${{ matrix.device_type=='RKNN'}}
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu18.04
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}/code:/code"
base_image: jadehh/miniconda3:aarch64-4.9.2
# Set an output parameter `uname` for use in subsequent steps
run: |
cd /code
pip install -r requirements.txt
pip install -r requirements/RKNN/requirements.txt
python packing_app.py \
--head_str \
"import sys \nsys.path.append('/usr/local/site-packages/')\nimport ruamel\nimport ruamel.yaml\nimport scipy\nimport scipy.spatial\nimport absl\nimport absl.logging\nimport google\nimport google.protobuf\nimport google.protobuf.descriptor\nimport wrapt\nimport google.protobuf.any_pb2\nimport absl.app\nimport google.protobuf.wrappers_pb2\nimport opt_einsum\nimport gast\nimport astunparse\nimport termcolor\nimport google.protobuf.json_format\nimport absl.testing\nimport absl.testing.parameterized\nimport flatbuffers\nimport requests\nimport h5py\nimport lmdb\nimport sklearn\nimport networkx\nimport onnx.numpy_helper\nimport onnx.backend\nimport onnx.backend.base\nimport ply\nimport ply.lex\nimport ply.yacc\nimport dill\n" \
--extra_sys_str /usr/local/site-packages \
--app_name local_conta_ocr_rknn \
--lib_path local_conta_ocr_aarch64_lib64 \
--is_exec True
- name: Ascend打包环境准备
if: ${{ matrix.device_type=='Ascend'}}
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu18.04
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}/code:/code"
base_image: jadehh/miniconda3:aarch64-4.9.2
# Set an output parameter `uname` for use in subsequent steps
run: |
cd /code
pip install -r requirements.txt
pip install -r requirements/Ascend/requirements.txt
python packing_app.py \
--head_str "import sys \nsys.path.append('/usr/local/Ascend/nnrt/latest/python/site-packages')\nsys.path.append('/usr/local/site-packages')\nfrom acllite.acllite_resource import AclLiteResource\nfrom acllite.acllite_imageproc import AclLiteImageProc\nfrom acllite.acllite_image import AclLiteImage\n" \
--extra_sys_str /usr/local/site-packages \
--app_name local_conta_ocr_ascend \
--lib_path local_conta_ocr_aarch64_lib64 \
--is_exec True
- name: 发布
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files:
"./code/Output/*"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # 给最高的权限