From 0b01ee34ce4daab44101673a1b709a84b955e0d1 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Mon, 28 Nov 2022 11:18:00 -0500 Subject: [PATCH] automate CI to push to PyPi --- .github/workflows/build-darwin.yml | 18 ++++++++++++++++++ .github/workflows/build-linux.yml | 18 ++++++++++++++++++ .github/workflows/build-windows.yml | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/.github/workflows/build-darwin.yml b/.github/workflows/build-darwin.yml index f097098..80cdbbe 100644 --- a/.github/workflows/build-darwin.yml +++ b/.github/workflows/build-darwin.yml @@ -92,3 +92,21 @@ jobs: with: name: wheels path: ./wheelhouse + + upload_pypi: + name: 'Upload packages' + needs: ['build_wheels'] + runs-on: 'ubuntu-latest' + if: github.event_name == 'release' && github.event.action == 'created' + steps: + - uses: actions/download-artifact@v2 + name: 'Download artifacts' + with: + name: 'artifact' + path: 'dist' + + - uses: pypa/gh-action-pypi-publish@release/v1 + name: "Publish package to PyPI" + with: + user: '__token__' + password: '${{ secrets.PYPI_API_TOKEN }}' diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 0a4ea58..c424b90 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -141,3 +141,21 @@ jobs: with: name: wheels path: ./wheelhouse + + upload_pypi: + name: 'Upload packages' + needs: ['build_wheels'] + runs-on: 'ubuntu-latest' + if: github.event_name == 'release' && github.event.action == 'created' + steps: + - uses: actions/download-artifact@v2 + name: 'Download artifacts' + with: + name: 'artifact' + path: 'dist' + + - uses: pypa/gh-action-pypi-publish@release/v1 + name: "Publish package to PyPI" + with: + user: '__token__' + password: '${{ secrets.PYPI_API_TOKEN }}' diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2249ba5..fc1e570 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -116,3 +116,22 @@ jobs: with: name: wheels path: ./wheelhouse + + upload_pypi: + name: 'Upload packages' + needs: ['build_wheels'] + runs-on: 'ubuntu-latest' + if: github.event_name == 'release' && github.event.action == 'created' + steps: + - uses: actions/download-artifact@v2 + name: 'Download artifacts' + with: + name: 'artifact' + path: 'dist' + + - uses: pypa/gh-action-pypi-publish@release/v1 + name: "Publish package to PyPI" + with: + user: '__token__' + password: '${{ secrets.PYPI_API_TOKEN }}' +