Skip to content

Commit

Permalink
created pypi_publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlue committed Feb 25, 2024
1 parent a647b87 commit 0e2c596
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Python package to PyPI

on:
push:
branches:
- master # Set this to your default branch

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # Use the Python version compatible with your project

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build package
run: python -m build

- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/master')
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
password: ${{ secrets.PYPI_TOKEN }}
user: __token__

0 comments on commit 0e2c596

Please sign in to comment.