diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..938abe3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Publish to PyPI + +on: + push: + tags: + - 'v*' # 当推送版本标签时触发 + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Extract version from tag + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + + - name: Update version in setup.py + run: | + sed -i "s/version='.*'/version='$VERSION'/g" setup.py + + - name: Build package + run: python -m build + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/* \ No newline at end of file diff --git a/README.md b/README.md index 639efcf..3072ab4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![PyPI Downloads](https://static.pepy.tech/badge/tapflow)](https://pepy.tech/projects/tapflow) + ## What is TapFlow TapFlow is a newly launched programming API framework for the TapData Live Data Platform. It allows developers and data engineers to build data pipelines and models using a simple powerful programming language. @@ -327,3 +329,6 @@ We welcome you to join our community and interact with us. You can: - Star us on [GitHub](https://github.com/tapdata/tapdata) - Join our [discord](https://discord.gg/xj79hnEB) community or [whatsApp group](https://chat.whatsapp.com/LeY1lVE5GPkEc3TZeEZgDF) + +## Stargazers over time +[![Stargazers over time](https://starchart.cc/tapdata/tapflow.svg?variant=adaptive)](https://starchart.cc/tapdata/tapflow) \ No newline at end of file diff --git a/setup.py b/setup.py index 589758a..8b9a049 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='tapflow', - version='0.2.51', + version='0.2.52', packages=find_packages(), install_requires=required, include_package_data=True, @@ -22,4 +22,6 @@ 'Operating System :: OS Independent', ], python_requires='>=3.6', + long_description=open("README.md").read(), + long_description_content_type="text/markdown", )