diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f1f23b2..05e44a3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -15,6 +15,9 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} + permissions: + # IMPORTANT: this permission is mandatory for Trusted Publishing + id-token: write strategy: matrix: os: [ubuntu-latest] @@ -34,18 +37,15 @@ jobs: run: python -m pip install cibuildwheel==4.0.0rc1 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - # to supply options, put them in 'env', like: - # env: - # CIBW_SOME_OPTION: value - # ... - - name: Upload to PyPI - run: | - python -m pip install --upgrade twine - python -m twine upload --repository pypi wheelhouse/*.whl + run: python -m cibuildwheel --output-dir dist + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - uses: actions/upload-artifact@v6 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl + path: ./dist/*.whl