Skip to content

Commit

Permalink
Create pypi-publish-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mwt committed Aug 9, 2022
1 parent 69cfe18 commit 9437d63
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/pypi-publish-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 9437d63

Please sign in to comment.