From 807aea0ff67446558be4e018b1c1dcfcacc51ec9 Mon Sep 17 00:00:00 2001 From: Fabricio Arend Torres <9096900+FabricioArendTorres@users.noreply.github.com> Date: Tue, 24 Oct 2023 18:13:01 +0200 Subject: [PATCH] Update python-publish.yml --- .github/workflows/python-publish.yml | 43 +++++++++++++++++++--------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b825eb7..2bf3dc5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,31 +13,46 @@ on: types: [published] jobs: - pypi-publish: - name: upload release to PyPI - runs-on: ubuntu-latest - # Specifying a GitHub environment is optional, but strongly encouraged - environment: release - permissions: - # IMPORTANT: this permission is mandatory for trusted publishing - id-token: write - steps: - - uses: actions/checkout@v3 + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Install dependencies run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install build - - name: Build package - run: python -m build + - name: Build a binary wheel and a source tarball + run: python3 -m build - name: Store the distribution packages uses: actions/upload-artifact@v3 with: name: python-package-distributions path: dist/ + + pypi-publish: + name: upload release to PyPI + needs: + - build + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: + name: release + url: https://pypi.org/p/enflows + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1