-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
183 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
cz bump --check-consistency --increment patch | ||
|
||
version_file=./pyproject.toml | ||
init_file=./xiaomusic/__init__.py | ||
# 获取当前版本号 | ||
current_version=$(grep -oE "version = \"[0-9]+\.[0-9]+\.[0-9]+\"" $version_file | cut -d'"' -f2) | ||
echo "当前版本号: "$current_version | ||
|
||
# 将版本号分割成三部分 | ||
major=$(echo $current_version | cut -d'.' -f1) | ||
minor=$(echo $current_version | cut -d'.' -f2) | ||
patch=$(echo $current_version | cut -d'.' -f3) | ||
|
||
echo "major: $major" | ||
echo "minor: $minor" | ||
echo "patch: $patch" | ||
|
||
# 将补丁号加1 | ||
patch=$((patch + 1)) | ||
|
||
# 生成新版本号 | ||
new_version="$major.$minor.$patch" | ||
|
||
# 将新版本号写入文件 | ||
sed -i "s/version.*/version = \"$new_version\"/g" $version_file | ||
sed -i "s/__version__.*/__version__ = \"$new_version\"/g" $init_file | ||
|
||
echo "新版本号:$new_version" | ||
|
||
git diff | ||
git add $version_file | ||
git add $init_file | ||
git commit -m "new version v$new_version" | ||
git tag v$new_version | ||
git push -u origin main --tags | ||
#git push -u origin main --tags |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "xiaomusic" | |
version = "0.1.95" | ||
description = "Play Music with xiaomi AI speaker" | ||
authors = [ | ||
{name = "涵曦", email = "[email protected]"}, | ||
{name = "涵曦", email = "[email protected]"}, | ||
] | ||
dependencies = [ | ||
"aiohttp>=3.8.6", | ||
|
@@ -33,19 +33,22 @@ build-backend = "pdm.backend" | |
lint = [ | ||
"ruff>=0.4.8", | ||
] | ||
dev = [ | ||
"commitizen>=3.27.0", | ||
] | ||
[tool.ruff] | ||
lint.select = [ | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"E", # pycodestyle - Error | ||
"F", # Pyflakes | ||
"I", # isort | ||
"W", # pycodestyle - Warning | ||
"UP", # pyupgrade | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"E", # pycodestyle - Error | ||
"F", # Pyflakes | ||
"I", # isort | ||
"W", # pycodestyle - Warning | ||
"UP", # pyupgrade | ||
] | ||
lint.ignore = [ | ||
"E501", # line-too-long | ||
"W191", # tab-indentation | ||
"E501", # line-too-long | ||
"W191", # tab-indentation | ||
] | ||
include = ["**/*.py", "**/*.pyi", "**/pyproject.toml"] | ||
|
||
|
@@ -63,3 +66,6 @@ version_scheme = "pep440" | |
version_provider = "pep621" | ||
update_changelog_on_bump = true | ||
major_version_zero = true | ||
version_files = [ | ||
"xiaomusic/__init__.py", | ||
] |