From 07b6569f672e2d942d68e39c14879bc7e543a269 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 2 Feb 2022 15:36:02 -0500 Subject: [PATCH] ci: deploy on releases --- .github/workflows/cd.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..df551f8 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,42 @@ +name: CD + +on: + workflow_dispatch: + release: + types: + - published + + +jobs: + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Build SDist and wheel + run: pipx run build + + - uses: actions/upload-artifact@v2 + with: + path: dist/* + + - name: Check metadata + run: pipx run twine check dist/* + + + publish: + needs: [dist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + password: ${{ secrets.pypi_password }}