Skip to content

Commit

Permalink
Merge pull request #113 from dhellmann/fix-pypi-publish
Browse files Browse the repository at this point in the history
update publish action based on python.org instructions
  • Loading branch information
dhellmann authored Nov 4, 2020
2 parents 5ac9afe + 6d7395d commit 27fb6a4
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
name: Upload Python Package

on:
release:
types: [created]
- push

jobs:
deploy:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI

runs-on: ubuntu-latest

Expand All @@ -21,11 +21,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
pip install setuptools wheel twine pbr
- name: Build sdist and wheel
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}

0 comments on commit 27fb6a4

Please sign in to comment.