diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 394ea0987f..4a713165b7 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -1,17 +1,35 @@ name: build-wheels-push -# on: push +on: push -on: - release: - types: - - published +# on: +# release: +# types: +# - published concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + # - name: check metadata + # run: pipx run twine check python/dist/* + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: python/dist/*.tar.gz + build_wheels: name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} @@ -38,39 +56,30 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up QEMU # Required for aarch64 builds if: ${{ contains(matrix.buildplat[1], 'aarch64') }} uses: docker/setup-qemu-action@v3 with: platforms: all + - name: Build wheels (aarch64) if: ${{ contains(matrix.buildplat[1], 'aarch64') }} uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} CIBW_ARCHS_LINUX: aarch64 + - name: Build wheels (not aarch64) if: ${{ !contains(matrix.buildplat[1], 'aarch64') }} uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - - uses: actions/upload-artifact@v3 - with: - path: ./wheelhouse/*.whl - - build_sdist: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Build sdist - shell: bash -l {0} - run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - path: dist/*.tar.gz + name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} + path: wheelhouse/*.whl # upload_testpypi: # name: >- @@ -88,12 +97,11 @@ jobs: # permissions: # id-token: write # IMPORTANT: mandatory for trusted publishing # steps: - # - uses: actions/download-artifact@v3 + # - uses: actions/download-artifact@v4 # with: - # # unpacks default artifact into dist/ - # # if `name: artifact` is omitted, the action will create extra parent dir - # name: artifact + # pattern: cibw-* # path: dist + # merge-multiple: true # - name: Download all # uses: pypa/gh-action-pypi-publish@release/v1 @@ -107,7 +115,7 @@ jobs: needs: [build_wheels, build_sdist] # upload to PyPI on every tag starting with 'v' - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') environment: name: pypi @@ -117,12 +125,11 @@ jobs: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact + pattern: cibw-* path: dist + merge-multiple: true - name: Download all uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index aa658d85a7..1317d0a2c5 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -8,6 +8,16 @@ concurrency: cancel-in-progress: true jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + shell: bash + run: pipx run build --sdist + build_wheels: name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} @@ -38,24 +48,16 @@ jobs: uses: docker/setup-qemu-action@v3 with: platforms: all + - name: Build wheels (aarch64) if: ${{ contains(matrix.buildplat[1], 'aarch64') }} uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} CIBW_ARCHS_LINUX: aarch64 + - name: Build wheels (not aarch64) if: ${{ !contains(matrix.buildplat[1], 'aarch64') }} uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - - build_sdist: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Build sdist - shell: bash -l {0} - run: pipx run build --sdist