diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5e14f7a..da23c41 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,7 +48,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: wheelhouse-${{ strategy.job-index }} + name: cibw-wheels-${{ strategy.job-index }} path: ./wheelhouse/*.whl build_sdist: @@ -71,33 +71,50 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: dist-${{ strategy.job-index }} + name: cibw-sdist-${{ strategy.job-index }} path: dist/*.tar.gz publish: - name: 'Upload to PyPI/TestPyPI' - runs-on: ubuntu-20.04 needs: [build_wheels, build_sdist] + environment: pypi + permissions: + id-token: write + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true - - name: Set up built items - uses: actions/download-artifact@v4 - with: - name: artifact - path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + # publish: + # name: 'Upload to PyPI/TestPyPI' + # runs-on: ubuntu-20.04 + # needs: [build_wheels, build_sdist] + # steps: + # - name: Set up Python + # uses: actions/setup-python@v5 + # with: + # python-version: '3.9' - - name: Publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - twine upload --verbose --repository ${{ github.event.inputs.repository }} dist/* + # - name: Set up built items + # uses: actions/download-artifact@v4 + # with: + # pattern: cibw-* + # path: dist + # merge-multiple: true + + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install setuptools wheel twine + + # - name: Publish + # env: + # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + # run: | + # twine upload --verbose --repository ${{ github.event.inputs.repository }} dist/*