From 6442192997295c27425871ece6fe1c316529f8b8 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Wed, 9 Oct 2024 14:17:20 +0800 Subject: [PATCH] add publish.yml --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1d89ac3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish + +on: + push: + tags: + - "v*.*.*" # Triggers when a tag starting with 'v' followed by version numbers is pushed + +jobs: + build-and-publish: + name: Build and Publish to PyPI + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build package + run: | + python setup.py sdist bdist_wheel + + - name: Publish package to PyPI + env: + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + twine upload dist/*