From 28de9722f6198b7a91263518a4a8db50660d9407 Mon Sep 17 00:00:00 2001 From: captchasolver Date: Mon, 14 Apr 2025 17:15:33 +0300 Subject: [PATCH] Add publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..0f03be4 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,34 @@ +name: Publish to PyPI + +on: + push: + tags: + - 'v*.*.*' # Workflow start when you push tag in folovings format: v1.0.0 + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.6' # Python version + + - name: Upgrade pip + run: pip install --upgrade pip + + - name: Install build dependencies + run: pip install build + + - name: Build the package + run: python -m build --sdist --wheel + + - name: Publish to PyPI via Twine + env: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + run: | + pip install twine + twine upload dist/* -u __token__ -p $PYPI_API_TOKEN \ No newline at end of file