From 1cf78a64575c146d92c03c8d211ae3912ee45b31 Mon Sep 17 00:00:00 2001 From: helgeerbe <59169507+helgeerbe@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:58:08 +0100 Subject: [PATCH] Update python-publish.yml --- .github/workflows/python-publish.yml | 42 ++++++++++++++++------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0c36fed..927c69e 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -8,24 +8,30 @@ on: types: [created] jobs: - deploy: - + build-n-publish: + name: Build and publish to PyPi runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/picframe + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + contents: write steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - name: Checkout source + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Build source and wheel distributions + run: | + python -m pip install --upgrade pip build twine + python -m build + twine check --strict dist/* + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1