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 7c7479c commit b181fe9
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
name: Upload Python Package

on:
# Trigger on release creation
release:
types: [created]

# Allow manual triggering for testing
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
# Step 1: Check out the repository code
- name: Check out code
uses: actions/checkout@v2

# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Use a specific Python version for consistency
python-version: '3.x'

# Step 3: Upgrade pip and install dependencies for building and publishing
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
# Step 4: Build the package
- name: Build the package
run: python -m build

# Step 5: Publish to PyPI
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} # PyPI username or __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # PyPI password or API token
run: twine upload dist/*
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload --verbose dist/*

0 comments on commit b181fe9

Please sign in to comment.