Skip to content

Commit 0641737

Browse files
committed
* 更新获取版本号方法
1 parent 742d849 commit 0641737

5 files changed

Lines changed: 91 additions & 37 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: dataset tools库打包
2+
3+
on:
4+
push:
5+
tags:
6+
- DatasetToolsV*
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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### 更新日志
2+
3+
#### DatasetToolsV1.8.1 - 2023-03-13
4+
* 更新获取版本号方法
5+
---
6+
7+
<details onclose>
8+
<summary>查看更多更新日志</summary>
9+
10+
#### dataset_toolsV1.0.7 - 2023-01-29
11+
* 支持创建文本检测数据集
12+
13+
#### dataset_toolsV1.0.6 - 2023-01-29
14+
* 支持制作VOC数据集
15+
---
16+
</details>

dataset_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-
full_version = '1.0.7'
9+
full_version = '1.0.8'

docs/文档介绍.md

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

setup.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,30 @@
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 = ["dataset_tools"]
1229
find_packages("dataset_tools", pack_list)
1330

1431
setup(
1532
name="dataset_tools",
16-
version="1.0.7",
33+
version=get_app_version(),
1734
keywords=("pip", "dataset_tools", ""),
1835
description="dataset_tools",
1936
long_description="",

0 commit comments

Comments
 (0)