From 552808daccc4d46916c385b582b6b8fbdc81f8f1 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Wed, 2 Feb 2022 02:48:32 -0300 Subject: [PATCH] cd: publish releases to PyPI with GA --- .github/workflows/publish-release.yml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 00000000..be88fdb4 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,33 @@ +name: release + +on: + release: + types: [published] + +jobs: + pypi: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Install pypa/build + run: | + python -m pip install build --user + + - name: Build the petl package as source tarball + run: | + # python setup.py sdist + python -m build --sdist --outdir dist/ . + + - name: Publish the package version ${{ github.event.release.tag_name }} to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} + print_hash: true