Skip to content

Commit

Permalink
Use GitHub's version of python package publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Chen-Wang committed Jun 25, 2020
1 parent 6ef0287 commit 27b74b7
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/publish.yml
@@ -1,31 +1,31 @@
name: Publish to PyPi
# 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:
release:
types:
- created
types: [created]

jobs:
publish-to-pypi:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Build a binary wheel and a source tarball
run: >-
python -m
pep517.build
--source
--binary
--out-dir dist/
.
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
- name: Set up Python
uses: actions/setup-python@v2
with:
user: __token__
password: ${{ secrets.pypi_password }}
python-version: '3.x'
- 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.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

0 comments on commit 27b74b7

Please sign in to comment.