From 7bb8db4c0116a0f3c8139200a78422ce632d6af9 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez <33620+esteve@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:46:18 +0100 Subject: [PATCH] Added CI workflow to build the extension and upload it to PyPI (#28) Signed-off-by: Esteve Fernandez --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a910c42 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + release-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Build release distributions + run: pipx run build + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + + permissions: + id-token: write + + # Dedicated environments with protections for publishing are strongly recommended. + environment: + name: release + url: https://pypi.org/p/colcon-ros-cargo + + 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@release/v1