From 28492af5bba1da3a2bed19389f96584e51c1e08f Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Wed, 22 Mar 2023 10:32:32 +0100 Subject: [PATCH] Update PyPI GitHub Actions workflow --- .github/workflows/upload-to-pypi.yml | 41 ++++++++++++++++------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/upload-to-pypi.yml b/.github/workflows/upload-to-pypi.yml index 2bc6e4d..4af91ee 100644 --- a/.github/workflows/upload-to-pypi.yml +++ b/.github/workflows/upload-to-pypi.yml @@ -4,25 +4,30 @@ on: release: types: [published] +permissions: + contents: read + jobs: upload: + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.7" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install setuptools wheel twine - - name: Package project - run: | - python setup.py sdist bdist_wheel - - name: Upload distributions - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - twine upload dist/* + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools wheel twine + - name: Package project + run: | + python setup.py sdist bdist_wheel + - name: Upload distributions + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + twine upload dist/*