diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 394ea0987f..45b6e7354c 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -1,17 +1,39 @@ 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@v3 + + - name: Build sdist + shell: bash -l {-1} + run: pipx run build --sdist + + - name: Check metadata + run: pipx run twine check python/dist/* + + - uses: actions/upload-artifact@v3 + with: + name: cibw-sdist + path: python/dist/*.tar.gz + + # - uses: actions/upload-artifact@v2 + # with: + # path: dist/*.tar.gz + build_wheels: name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} @@ -54,39 +76,64 @@ jobs: uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - - uses: actions/upload-artifact@v3 + # - uses: actions/upload-artifact@v3 + # with: + # path: ./wheelhouse/*.whl + + - uses: actions/upload-artifact@v4 with: - path: ./wheelhouse/*.whl + name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} + path: wheelhouse/*.whl - build_sdist: - name: Build source distribution + upload_testpypi: + name: >- + Publish highspy to TestPyPI runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + needs: [build_wheels, build_sdist] - - name: Build sdist - shell: bash -l {0} - run: pipx run build --sdist + # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - - uses: actions/upload-artifact@v3 + environment: + name: testpypi + url: https://testpypi.org/p/highspy + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true + # - uses: actions/download-artifact@v3 + # with: + # # unpacks default artifact into dist/ + # # if `name: artifact` is omitted, the action will create extra parent dir + # name: artifact + # path: dist + + - name: Download all + uses: pypa/gh-action-pypi-publish@release/v1 with: - path: dist/*.tar.gz + repository-url: https://test.pypi.org/legacy/ - # upload_testpypi: + # upload_pypi: # name: >- - # Publish highspy to TestPyPI + # Publish highspy to PyPI # runs-on: ubuntu-latest # 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: testpypi - # url: https://testpypi.org/p/highspy + # name: pypi + # url: https://pypi.org/p/highspy # permissions: # id-token: write # IMPORTANT: mandatory for trusted publishing + # steps: # - uses: actions/download-artifact@v3 # with: @@ -97,32 +144,3 @@ jobs: # - name: Download all # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # repository-url: https://test.pypi.org/legacy/ - - upload_pypi: - name: >- - Publish highspy to PyPI - runs-on: ubuntu-latest - 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') - - environment: - name: pypi - url: https://pypi.org/p/highspy - - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - uses: actions/download-artifact@v3 - with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact - path: dist - - - name: Download all - uses: pypa/gh-action-pypi-publish@release/v1