Skip to content

Commit

Permalink
Merge pull request #654 from oduwsdl/issue-630
Browse files Browse the repository at this point in the history
Utilize GH Workflow to publish to PyPI
  • Loading branch information
machawk1 authored May 19, 2020
2 parents 4bac5b1 + f4fe811 commit eb3a269
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
build-n-publish:
name: Build and Publish Package
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@master
with:
python-version: 3.8
- name: Upgrade setuptools and wheel
run: python -m pip install --user --upgrade setuptools wheel
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
# The PyPI API token (password) was generated as per https://pypi.org/help/#apitoken
# The token is stored in this GH repo under `Settings > Secrets > pypi_password`
1 change: 0 additions & 1 deletion release-requirements.txt

This file was deleted.

10 changes: 5 additions & 5 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ git tag $TAG_NAME
git push
git push origin $TAG_NAME

# Install release requirements for pypi push
pip3 install twine

# Push to pypi
rm -rf dist; python3 setup.py sdist bdist_wheel; python3 -m twine upload dist/*
# The `.github/workflows/dist.yml` Workflow is triggered automatically
# when the repo is tagged by running this Shell script
# or manually creating a relase in GH.
# In either case, the Workflow will build the Python package
# in GH's CI infrastructure and publish it to PyPI.

0 comments on commit eb3a269

Please sign in to comment.