File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,20 @@ jobs:
3030 with :
3131 python-version : ' 3.10'
3232
33- - name : Get latest test version and calculate next version
33+ - name : Get latest version from PyPI and calculate next version
3434 id : version
3535 run : |
36- # 获取所有 agentrun-inner-test-v* 的 tags,找到最新版本
37- LATEST_TAG =$(git tag -l " agentrun-inner-test-v*" | sort -V | tail -n 1 )
36+ # 从 PyPI 获取 agentrun-inner-test 的最新版本
37+ PYPI_RESPONSE =$(curl -s https://pypi.org/pypi/ agentrun-inner-test/json 2>/dev/null || echo "" )
3838
39- if [ -z "$LATEST_TAG " ]; then
40- # 如果没有找到任何 tag ,从 0.0.0 开始
39+ if [ -z "$PYPI_RESPONSE " ] || echo "$PYPI_RESPONSE" | grep -q "Not Found" ; then
40+ # 如果包不存在 ,从 0.0.0 开始
4141 CURRENT_VERSION="0.0.0"
42- echo "No existing test tags found , starting from 0.0.0"
42+ echo "Package not found on PyPI , starting from 0.0.0"
4343 else
44- # 从 tag 中提取版本号
45- CURRENT_VERSION="${LATEST_TAG#agentrun-inner-test-v}"
46- echo "Latest test tag: $LATEST_TAG (version : $CURRENT_VERSION) "
44+ # 从 PyPI 响应中提取最新版本
45+ CURRENT_VERSION=$(echo "$PYPI_RESPONSE" | python3 -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
46+ echo "Latest version on PyPI : $CURRENT_VERSION"
4747 fi
4848
4949 # 解析版本号
You can’t perform that action at this time.
0 commit comments