From de638bd30ebb8a1a96f20990fcda249d03260cbb Mon Sep 17 00:00:00 2001 From: David Date: Sat, 23 Nov 2024 18:49:48 +0100 Subject: [PATCH] Update pypi_publish.yml --- .github/workflows/pypi_publish.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 7df413a..dfd7439 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,3 +1,5 @@ +name: Upload Python Package + on: # Trigger on release creation release: @@ -17,21 +19,23 @@ jobs: # Step 2: Set up Python - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: '3.9' # Use a specific Python version for consistency # Step 3: Upgrade pip and install dependencies for building and publishing - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build twine + + # Step 4: Build the package + - name: Build the package + run: python -m build - # Step 4: Build and publish to PyPI - - name: Build and publish + # Step 5: Publish to PyPI + - name: Publish to PyPI env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} # PyPI username or __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # PyPI password or API token + run: twine upload dist/*