v1.1.3 #20
Workflow file for this run
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
name: Upload Python Package | |
on: | |
release: | |
types: [published] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout latest code | |
uses: actions/checkout@v4 # 确保拉取最新代码 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
# 清理 dist 文件夹,确保没有旧的构建文件 | |
- name: Clean dist folder | |
run: rm -rf dist | |
# 检查 config.ini 文件内容,确保最新 | |
- name: Check config.ini contents | |
run: cat fastshot/config.ini # 可选步骤,用于验证 config.ini 是最新的 | |
# 构建项目 | |
- name: Build package | |
run: python -m build # 构建打包文件 | |
# 上传并发布到 PyPI | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} # 使用 PyPI API token | |
skip_existing: true # 避免重新上传相同版本的文件 |