-
Notifications
You must be signed in to change notification settings - Fork 1
186 lines (179 loc) · 6.37 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
name: 箱号服务发布
on:
push:
tags:
- conta_serviceV*
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_service
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
python packing_app.py \
--head_str "import sys\nsys.path.append('/usr/local/conta_detect-1.0/python_lib')\nsys.path.append('/usr/local/site-packages')\n" \
--is_exec False
- name: Amd64打包编译
if: ${{ matrix.device_type=='Amd64'}}
run: |
cd code
python packing_app.py \
--head_str "import sys\nsys.path.append('/usr/local/conta_detect-1.0/python_lib')\nsys.path.append('/usr/local/site-packages')\n"\
--name 箱号服务Amd64 \
--app_name conta_service_amd64 \
--lib_path conta_service_amd64_lib64 \
--is_exec False
- name: 发布
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files:
"./code/Output/*"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # 给最高的权限
Py310:
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_service
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
python packing_app.py \
--extra_sys_str /usr/local/site-packages,/usr/local/opencv \
--app_name local_conta_service_onnx \
--lib_path local_conta_service_x86_lib64 \
--is_exec False \
--exclude_files libbz2.so.1.0,libcrypto.so.1.1,libsqlite3.so.0,libssl.so.1.1,libz.so.1,cryptography/hazmat/bindings/_openssl.abi3.so
- 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"]
# steps:
# - name: 下载代码
# uses: actions/checkout@v3
# with:
# repository: jadehh/ContainerOCR
# ref: conta_service
# 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
# python packing_app.py \
# --extra_sys_str /usr/local/site-packages \
# --app_name local_conta_service_rknn \
# --lib_path local_conta_service_aarch64_lib64
# - 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
# python packing_app.py \
# --extra_sys_str /usr/local/site-packages \
# --app_name local_conta_service_ascend \
# --lib_path local_conta_service_aarch64_lib64
#
# - name: 发布
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files:
# "./code/Output/*"
# env:
# GITHUB_TOKEN: ${{ secrets.GH_PAT }} # 给最高的权限