Skip to content

Commit

Permalink
Merge pull request #59 from dhellmann/pypi-publish-action
Browse files Browse the repository at this point in the history
add github action for publishing releases
  • Loading branch information
dhellmann committed Nov 28, 2020
2 parents 3da34b9 + 25abada commit 1bd5d41
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
- push

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
if: ${{ github.repository_owner == 'imapautofiler' }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine pbr
- name: Build sdist and wheel
run: |
python setup.py sdist bdist_wheel
- 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 1bd5d41

Please sign in to comment.