@@ -110,15 +110,19 @@ jobs:
110110 # 等待PyPI索引更新
111111 sleep 30
112112
113+ # 获取不带v前缀的版本号
114+ VERSION=${{ github.event.release.tag_name }}
115+ VERSION=${VERSION#v}
116+
113117 # 尝试安装刚发布的包
114- pip install simtradelab==${{ github.event.release.tag_name }}
118+ pip install simtradelab==$VERSION
115119
116120 # 验证安装
117- python -c "
118- import simtradelab
119- from simtradelab.backtest.runner import BacktestRunner
120- print(f'✅ SimTradeLab {simtradelab.__version__} installed successfully')
121- "
121+ python -c 'import simtradelab; from simtradelab.backtest.runner import BacktestRunner; print("✅ SimTradeLab " + simtradelab.__version__ + " installed successfully")'
122+
123+ - name : Install script dependencies
124+ run : |
125+ pip install gitpython
122126
123127 - name : Generate Release Notes
124128 id : release_notes
@@ -150,18 +154,21 @@ jobs:
150154 uses : actions/github-script@v7
151155 with :
152156 script : |
157+ const tagName = '${{ github.event.release.tag_name }}';
158+ const version = tagName.replace(/^v/, '');
159+
153160 github.rest.issues.createComment({
154161 issue_number: context.payload.release.id,
155162 owner: context.repo.owner,
156163 repo: context.repo.repo,
157- body: `🎉 SimTradeLab ${{ github.event.release.tag_name } } has been successfully published to PyPI!
164+ body: `🎉 SimTradeLab ${tagName } has been successfully published to PyPI!
158165
159166 📦 **Installation:**
160167 \`\`\`bash
161- pip install simtradelab==${{ github.event.release.tag_name } }
168+ pip install simtradelab==${version }
162169 \`\`\`
163170
164- 🔗 **PyPI Link:** https://pypi.org/project/simtradelab/${{ github.event.release.tag_name } }/
171+ 🔗 **PyPI Link:** https://pypi.org/project/simtradelab/${version }/
165172
166173 ✅ **Verification:** Package installation verified successfully.
167174
0 commit comments