Skip to content

Commit

Permalink
Merge pull request #188 from staylorx/master
Browse files Browse the repository at this point in the history
Add github action to publish to pypi
  • Loading branch information
gwaybio authored Feb 8, 2022
2 parents 48af26a + 0d1f97b commit ea3340c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on: [release]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install pypa/build
run: python -m pip install setuptools build wheel --user

- name: Build a binary wheel
run: python setup.py sdist bdist_wheel

- name: Publish any distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish tagged distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build
*.egg-info
.coverage*
.idea/*
/dist

0 comments on commit ea3340c

Please sign in to comment.