From 08193a56f7717397af6c9f60ee0f3e874cee1870 Mon Sep 17 00:00:00 2001 From: Manish Srivastava <50901005+mk-srivastava@users.noreply.github.com> Date: Tue, 10 Sep 2024 23:22:02 +0530 Subject: [PATCH] ci: add release workflow for automating the PyPI publishing process (#156) * added workflow for automating the pypi publishing process --------- Co-authored-by: Eugeny Parshutin --- .github/workflows/release.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 339c284..b88140b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: - name: Install cibuildwheels run: python -m pip install cibuildwheel==2.20.0 - name: Build ittapi python wheels - run: python -m cibuildwheel python --output-dir python_dist/${{ runner.os }} + run: python -m cibuildwheel python --output-dir python_dist env: CIBW_BUILD: cp3* CIBW_SKIP: ${{ matrix.cibw_skip_args }} @@ -114,3 +114,24 @@ jobs: asset_path: ./ittapi_build_${{ github.ref_name }}.zip asset_name: ittapi_build_${{ github.ref_name }}.zip asset_content_type: application/zip + + # upload the built wheels to PyPi + upload_to_pypi: + name: Upload the wheel files to PyPi + runs-on: ubuntu-latest + needs: [python_build, create_release] + steps: + - name: Download artifacts + uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 + with: + pattern: build-artifacts-* + merge-multiple: true + - name: List wheel files + run: find -name *.whl + - name: Publish package distributions to PyPi + uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # v1.10.1 + with: + password: ${{ secrets.PYPI }} + repository-url: https://upload.pypi.org/legacy/ + packages-dir: python_dist + skip-existing: true