Skip to content

Commit 421b28c

Browse files
committed
* 自动打包并发布
1 parent faec596 commit 421b28c

File tree

6 files changed

+117
-62
lines changed

6 files changed

+117
-62
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: opencv tools库打包
2+
3+
on:
4+
push:
5+
tags:
6+
- OpencvToolsV*
7+
jobs:
8+
release:
9+
name: ${{ matrix.os }} 创建Release
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest"
15+
steps:
16+
- name: 克隆代码
17+
uses: actions/checkout@v3
18+
- name: 创建发行版本
19+
id: create_release
20+
uses: actions/create-release@v1
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: ${{ github.ref }}
26+
body_path: CONTRIBUTING.md
27+
draft: false
28+
prerelease: false
29+
build:
30+
name: Python制作Wheel
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: 安装Python环境
35+
uses: actions/setup-python@v3
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
- name: 安装依赖
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install wheel
42+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
43+
- name: 打包
44+
run: |
45+
python setup.py sdist bdist_wheel
46+
rm -r build
47+
rm -r *.egg-info
48+
ls
49+
## 发布
50+
- name: 发布
51+
uses: softprops/action-gh-release@v1
52+
if: startsWith(github.ref, 'refs/tags/')
53+
with:
54+
files: "dist/*.whl"
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
### 更新日志
2+
3+
4+
#### OpencvToolsV1.2.5 - 2023-03-13
5+
* 自动打包并发布
6+
---
7+
8+
<details onclose>
9+
<summary>查看更多更新日志</summary>
10+
11+
#### OpencvToolsV1.2.4 - 2023-02-24
12+
* 优化VideoCaptureBaseProcess
13+
---
14+
15+
#### OpencvToolsV1.2.3 - 2023-02-23
16+
* 优化Ascend解码速度
17+
----
18+
#### OpencvToolsV1.2.2 - 2023-02-22
19+
* 优化Ascend解码速度
20+
----
21+
#### OpencvToolsV1.2.1 - 2023-02-01
22+
* 优化draw ocr 方法
23+
----
24+
#### OpencvToolsV1.2.0 - 2023-01-16
25+
* 输出相机解码失败原因,输出解码失败详细原因
26+
---
27+
#### OpencvToolsV1.1.9 - 2023-01-16
28+
* 输出相机解码失败原因,输出解码失败详细原因
29+
---
30+
#### OpencvToolsV1.1.8 - 2023-01-16
31+
* 自动安装jade最新版本
32+
---
33+
#### OpencvToolsV1.1.7 - 2022-12-30
34+
* 支持华为Ascend解码
35+
* 日志输出Ascend芯片解码
36+
* 优化Ascend芯片解码
37+
* device类型统一使用ascend
38+
* update CVShowBoxes 方法
39+
* update base64转图片和cv2的方法
40+
---
41+
</details>

README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
## OpencvToolsV1.2.4
1+
# OpencvTools
22
Opencv相关操作
33

4-
### 打包为wheel文件
5-
6-
安装wheel
7-
```bash
8-
pip install wheel
9-
```
10-
打包wheel
11-
```bash
12-
python setup.py sdist bdist_wheel
13-
```
14-
> 需要删除其他包的缓存egg-info
15-
16-
### 更新日志
17-
* 优化VideoCaptureBaseProcess
18-
* 优化Ascend解码速度
19-
* 优化draw ocr 方法
20-
* 输出相机解码失败原因,输出解码失败详细原因
21-
* 自动安装jade最新版本
22-
* 支持华为Ascend解码
23-
* 日志输出Ascend芯片解码
24-
* 优化Ascend芯片解码
25-
* device类型统一使用ascend
26-
* update CVShowBoxes 方法
27-
* update base64转图片和cv2的方法

docs/文档介绍.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

opencv_tools/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# @Email : jadehh@1ive.com
77
# @Software : Samples
88
# @Desc :
9-
version = "1.2.4"
9+
version = "1.2.5"

setup.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,29 @@
77
# @Software : Samples
88
# @Desc :
99
from setuptools import setup, find_packages
10+
def get_app_version():
11+
try:
12+
with open("CONTRIBUTING.md","rb") as f:
13+
content = str(f.read(),encoding="utf-8").split("#### ")[1].split(" - ")[0]
14+
version = ""
15+
if "v" in content and "V" in content:
16+
version = content.split("V")[-1]
17+
elif "v" in content:
18+
version = content.split("v")[-1]
19+
elif "V" in content:
20+
version = content.split("V")[-1]
21+
if version:
22+
return version
23+
else:
24+
raise "please check CONTRIBUTING contain version"
25+
except:
26+
raise "please check CONTRIBUTING contain version"
1027
if __name__ == '__main__':
1128
pack_list = ["opencv_tools"]
1229
find_packages("opencv_tools", pack_list)
1330
setup(
1431
name="opencv_tools",
15-
version="1.2.4",
32+
version=get_app_version(),
1633
keywords=("pip", "opencv_tools", ""),
1734
description="opencv_tools",
1835
long_description="",

0 commit comments

Comments
 (0)