From 76239c548e9b205b0a519b73c3949da99b58ef65 Mon Sep 17 00:00:00 2001 From: Brad Rogers Date: Mon, 30 Mar 2020 17:18:24 -0700 Subject: [PATCH 1/2] Create PyPi Upload Action - Add action to upload to PyPi - Publish python2 and python3 builds - Publish python3 source --- .github/workflows/pypiupload.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/pypiupload.yml diff --git a/.github/workflows/pypiupload.yml b/.github/workflows/pypiupload.yml new file mode 100644 index 00000000..65f115a2 --- /dev/null +++ b/.github/workflows/pypiupload.yml @@ -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: Publish to PyPi + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.x] + + steps: + - uses: actions/checkout@v2 + - name: Publish to PyPi + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build + run: | + python setup.py bdist_wheel + - name: Build Sources + run: | + python setup.py sdist + if: ${{ matrix.python-version }} == '3.x' + - name: Publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine check dist/* + twine upload dist/* From 446c2d762ba87220db049cff5a31ff44052a8a1e Mon Sep 17 00:00:00 2001 From: Brad Rogers Date: Tue, 31 Mar 2020 15:29:26 -0700 Subject: [PATCH 2/2] Modify secret usage --- .github/workflows/pypiupload.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypiupload.yml b/.github/workflows/pypiupload.yml index 65f115a2..f54a699b 100644 --- a/.github/workflows/pypiupload.yml +++ b/.github/workflows/pypiupload.yml @@ -33,8 +33,8 @@ jobs: if: ${{ matrix.python-version }} == '3.x' - name: Publish env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.pypi_secret }} run: | twine check dist/* twine upload dist/*