From d3dbd6e25aa1dd523117e7ea2ef13231c8dc8104 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Fri, 18 Oct 2024 03:54:35 +0300 Subject: [PATCH 1/4] testpypi updated artifacts --- .github/workflows/build-wheels-push.yml | 118 ++++++++++++++---------- 1 file changed, 68 insertions(+), 50 deletions(-) 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 From 021e333dde66686d6b7e13ddabd2390f058b6b8f Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Fri, 18 Oct 2024 03:59:17 +0300 Subject: [PATCH 2/4] sdist workflow shell --- .github/workflows/build-wheels-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 45b6e7354c..5e2c79023d 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - name: Build sdist - shell: bash -l {-1} + shell: bash run: pipx run build --sdist - name: Check metadata From a3fb5f07c967d2673adf77b4522e83c6e4d5a232 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Fri, 18 Oct 2024 04:02:01 +0300 Subject: [PATCH 3/4] remove check --- .github/workflows/build-wheels-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 5e2c79023d..3df0ce7f52 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -22,8 +22,8 @@ jobs: shell: bash run: pipx run build --sdist - - name: Check metadata - run: pipx run twine check python/dist/* + # - name: check metadata + # run: pipx run twine check python/dist/* - uses: actions/upload-artifact@v3 with: From eda5cbeebb790c53aa5b7afe4190356ee9217b3d Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Fri, 18 Oct 2024 11:53:42 +0300 Subject: [PATCH 4/4] deploy --- .github/workflows/build-wheels-push.yml | 85 +++++++++++-------------- .github/workflows/build-wheels.yml | 22 ++++--- 2 files changed, 49 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 3df0ce7f52..4a713165b7 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -16,7 +16,7 @@ jobs: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build sdist shell: bash @@ -25,15 +25,11 @@ jobs: # - name: check metadata # run: pipx run twine check python/dist/* - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 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] }} @@ -60,34 +56,61 @@ 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 - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} path: wheelhouse/*.whl - upload_testpypi: + # upload_testpypi: + # name: >- + # Publish highspy to TestPyPI + # 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: 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 + + # - 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 TestPyPI + Publish highspy to PyPI runs-on: ubuntu-latest needs: [build_wheels, build_sdist] @@ -95,52 +118,18 @@ jobs: # 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@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: - 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 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