From 67cbc63adfdbdc0c6a96b9cb0d11499aeda77561 Mon Sep 17 00:00:00 2001 From: rafa-be Date: Fri, 27 Sep 2024 16:51:45 +0200 Subject: [PATCH] Adds a GitHub action to build and upload the package to PyPI on release. (#16) Signed-off-by: rafa-be --- .github/workflows/pypi.yml | 37 +++++++++++++++++++++++++++++++++++++ parfun/about.py | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..2e6961d --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,37 @@ +name: Publish Python package to PyPI + +on: + release: + types: [created] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + pip install -r requirements.txt + + - name: Build package + run: python -m build + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python -m twine upload dist/* diff --git a/parfun/about.py b/parfun/about.py index b378fc6..fb16410 100644 --- a/parfun/about.py +++ b/parfun/about.py @@ -1 +1 @@ -__version__ = "7.0.0" +__version__ = "7.0.1"