update version 0.3.44 #254
Workflow file for this run
This file contains hidden or 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: Build and Publish to PyPI | |
on: | |
push: | |
tags: | |
- '*' # 监听所有标签推送 | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true # 启用 LFS 支持 | |
fetch-depth: 0 # 确保能够获取全部历史和标签 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel build | |
- name: Build package and wheel | |
run: | | |
python -m build --wheel | |
- name: Find wheel file | |
run: echo "WHEEL_FILE=$(basename $(ls ./dist/*.whl))" >> $GITHUB_ENV | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.4.2 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
body: "Description of the release" | |
draft: false | |
prerelease: false | |
- name: Upload wheel to GitHub Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/${{ env.WHEEL_FILE }} | |
asset_name: ${{ env.WHEEL_FILE }} | |
asset_content_type: application/octet-stream |