Skip to content

Commit

Permalink
Update pypi_publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbhr committed Nov 23, 2024
1 parent b4a93ab commit de638bd
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Upload Python Package

on:
# Trigger on release creation
release:
Expand All @@ -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/*

0 comments on commit de638bd

Please sign in to comment.