Skip to content

Commit

Permalink
chore:add publish.py
Browse files Browse the repository at this point in the history
  • Loading branch information
2061360308 committed Dec 19, 2023
1 parent 26d8230 commit 6089caa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ print(api_list())
├── test.py 手动测试/ 使用示例
```

### 更新
#### 更新
项目使用towncrier自动生成更新日志

在 newsfragments 目录下,创建一个新的文本文件。这个文件的名字应该是一个唯一的编号,后缀是 .rst。
Expand All @@ -66,7 +66,11 @@ print(api_list())
在这个文件中,写下你的更改的描述。这个描述应该是简短的,通常只有一到两句话。
例如`Added support for the XYZ feature.`

### 发布新版本
#### 发布新版本
自动:
运行 python publish.py

手动:
使用bumpversion自动更新版本号,提交并发布标签
你需要安装bumpversion然后执行
```bash
Expand Down
2 changes: 1 addition & 1 deletion package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
print("copy README.md end")

try:
with io.open(os.path.join(here, 'CHANGELOG.md'), encoding='utf-8') as f:
with io.open(os.path.join(here, '../CHANGELOG.md'), encoding='utf-8') as f:
changelog = f.read()
except FileNotFoundError:
changelog = ''
Expand Down
12 changes: 12 additions & 0 deletions publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import subprocess

# Bump version
subprocess.check_call(['bumpversion', 'patch'])

# Push changes to remote
subprocess.check_call(['git', 'push'])
subprocess.check_call(['git', 'push', '--tags'])

# Run towncrier
subprocess.check_call(['towncrier', '--yes'])
8 changes: 4 additions & 4 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pprint import pprint
import dotenv

from package.NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list
from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list

# from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list

Expand Down Expand Up @@ -112,7 +112,7 @@ def login_refresh():
pass
# print(api_list())
# print(api_help())
song_url_v1_test()
# song_url_v1_test()
# top_mv_test()
# search_test()
# search_default_test()
Expand All @@ -122,6 +122,6 @@ def login_refresh():
# top_playlist_highquality_test()
# captcha_sent_test()
# login_cellphone_test()
user_account_test()
# user_account_test()
# playlist_track_all_test()
# login_refresh()
login_refresh()

0 comments on commit 6089caa

Please sign in to comment.