From ed011cb9d02af16f5f2184310659008783ae222b Mon Sep 17 00:00:00 2001 From: Cooper Ry Lees Date: Wed, 2 Dec 2020 12:13:46 -0800 Subject: [PATCH] Add GitHub Action to release to PyPI (#44) Summary: - On a GitHub release creation Github actions will build + upload versions of xar Addresses making releases happen so we don't get so stale again as reported in https://github.com/facebookincubator/xar/issues/43 Pull Request resolved: https://github.com/facebookincubator/xar/pull/44 Reviewed By: terrelln Differential Revision: D25277583 Pulled By: cooperlees fbshipit-source-id: f0c98801bb46057b4736b445126256d16f7cf762 --- .github/actions/workflows/pypi_upload.yml | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/actions/workflows/pypi_upload.yml diff --git a/.github/actions/workflows/pypi_upload.yml b/.github/actions/workflows/pypi_upload.yml new file mode 100644 index 0000000..5df91d9 --- /dev/null +++ b/.github/actions/workflows/pypi_upload.yml @@ -0,0 +1,31 @@ +name: pypi_upload + +on: + release: + types: created + +jobs: + build: + name: PyPI Upload + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + + - name: Install latest pip, setuptools, twine + wheel + run: | + python -m pip install --upgrade pip setuptools twine wheel + + - name: Build wheels + run: | + python setup.py bdist_wheel + python setup.py sdist + + - name: Upload to PyPI via Twine + env: + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + twine upload --verbose -u '__token__' dist/*