diff --git a/.github/workflows/pypi-publish-release.yml b/.github/workflows/pypi-publish-release.yml new file mode 100644 index 0000000..dd0bb43 --- /dev/null +++ b/.github/workflows/pypi-publish-release.yml @@ -0,0 +1,51 @@ +name: Upload Python Package + +on: + release: + types: [published] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.7 + uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - name: Install pypa/build + run: | + python -m pip install --upgrade pip + pip install build + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ . + - name: Upload distribution artifact for other jobs + uses: actions/upload-artifact@v3 + with: + name: certbot-dns-bunny-dist + path: dist/ + + publish: + name: Publish distribution to PyPI + runs-on: ubuntu-latest + needs: build + steps: + - name: Download distribution from build job + uses: actions/download-artifact@v3 + with: + name: certbot-dns-bunny-dist + path: dist/ + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + username: __token__ + password: ${{ secrets.pypi_api_key }}