From 13a81e8f94c91c3b4d88f942b75fc05b75a870b9 Mon Sep 17 00:00:00 2001 From: AndreaDAmico Date: Fri, 18 Apr 2025 10:41:05 -0400 Subject: [PATCH] Defining PyPi publishing Change-Id: I6412a016e592f461bdef9e8d34ccacf0b8f078f5 --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb1e511..b11bc21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,46 @@ jobs: - tox_env: docs dnf_install: graphviz + release-build: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Telecominfraproject' }} + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: build release distributions + run: | + python -m pip install build + python -m build + + - name: upload windows dists + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Telecominfraproject' }} + permissions: + id-token: write + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f + other-platforms: name: Tests on other platforms runs-on: ${{ matrix.os }}