From 8212486163f7052562b670e6baf446124582b801 Mon Sep 17 00:00:00 2001 From: Shane-J-Latham Date: Fri, 9 Aug 2024 18:44:14 +1000 Subject: [PATCH] Added upload-to-pypi in .github/workflows/python-wheel-vcpkg.yml workflow. --- .github/workflows/python-wheel-vcpkg.yml | 26 ++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-wheel-vcpkg.yml b/.github/workflows/python-wheel-vcpkg.yml index 36f43f9..f859f39 100644 --- a/.github/workflows/python-wheel-vcpkg.yml +++ b/.github/workflows/python-wheel-vcpkg.yml @@ -143,7 +143,7 @@ jobs: python -m pip install "Cython" "numpy" "wheel" "setuptools>=42" "versioneer[toml]" "scikit-build" "cmake" "ninja" - name: Create python sdist - run: python setup.py sdist --formats=gztar,zip + run: python setup.py sdist --formats=zip - name: Upload python sdist uses: actions/upload-artifact@v4 @@ -166,6 +166,28 @@ jobs: merge-multiple: true - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: ./release_artifacts/* + + publish: + name: Upload release to PyPI + needs: [build_sdist, build_wheels] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pyemblite + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Download python sdist and wheels + uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: ./release_artifacts/ + merge-multiple: true + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: ./release_artifacts/