From 64b536fb53b48ad8a73c4a89bfc67afdae445a63 Mon Sep 17 00:00:00 2001 From: Adrien Beraud Date: Thu, 29 Oct 2026 21:48:33 -0400 Subject: [PATCH] ci: publish Python wheels from the tag release workflow --- .github/workflows/python-wheels.yml | 23 ++--------------------- .github/workflows/release-package.yml | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index cc7b0327..d624a252 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -4,10 +4,10 @@ permissions: contents: read on: - release: - types: [published] push: + branches: ['**'] pull_request: + workflow_call: workflow_dispatch: jobs: @@ -82,22 +82,3 @@ jobs: with: name: opendht-wheels-win_amd64 path: ./build/wheelhouse/*.whl - - publish: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - needs: [build_wheels, build_wheels_windows] - environment: - name: pypi - url: https://pypi.org/p/opendht - permissions: - id-token: write - steps: - - uses: actions/download-artifact@v8 - with: - pattern: opendht-wheels-* - path: dist - merge-multiple: true - - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index 47625a2b..6b710b6d 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -25,6 +25,12 @@ jobs: contents: read packages: read + python-wheels: + name: Build Python wheels + uses: ./.github/workflows/python-wheels.yml + permissions: + contents: read + build-and-push-deps-image: name: Dependency Docker image runs-on: ubuntu-latest @@ -627,6 +633,25 @@ jobs: fi npm publish ./dist/*.tgz --access public --provenance --tag "$dist_tag" + publish-pypi: + name: Publish opendht to PyPI + needs: [create-github-release, python-wheels] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/opendht + permissions: + contents: read + id-token: write + steps: + - uses: actions/download-artifact@v8 + with: + pattern: opendht-wheels-* + path: dist + merge-multiple: true + - name: Publish wheels + uses: pypa/gh-action-pypi-publish@release/v1 + publish-crate: name: Publish opendht to crates.io needs: create-github-release