diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 23c05a7629d0..0dc2ef1f49cb 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -69,9 +69,9 @@ jobs: run: twine check dist/* - name: Upload sdist result - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: sdist + name: cibw-sdist path: dist/*.tar.gz if-no-files-found: error @@ -140,9 +140,9 @@ jobs: platforms: arm64 - name: Download sdist - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: sdist + name: cibw-sdist path: dist/ - name: Build wheels for CPython 3.12 @@ -186,8 +186,30 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} if: matrix.cibw_archs != 'aarch64' - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: wheels + name: cibw-wheels-${{ runner.os }}-${{ matrix.cibw_archs }} path: ./wheelhouse/*.whl if-no-files-found: error + + publish: + if: github.event_name == 'release' && github.event.action == 'published' + name: Upload release to PyPI + needs: [build_sdist, build_wheels] + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - name: Download packages + uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true + + - name: Print out packages + run: ls dist + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ffa9c7524a5..2e40b29cc449 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -339,7 +339,7 @@ jobs: with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images"