From 98e5b4b7bde6c62bb21f38b2b417a95df19c2d50 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:21:10 +0200 Subject: [PATCH 01/12] Play with GA build actions since package is not installing on Windows --- .github/workflows/build-wheels-windows.yml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build-wheels-windows.yml diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml new file mode 100644 index 0000000..2207bb8 --- /dev/null +++ b/.github/workflows/build-wheels-windows.yml @@ -0,0 +1,35 @@ +# This workflow builds Python wheels for Windows using cibuildwheel +# See: https://cibuildwheel.readthedocs.io/en/stable/ + +name: Build wheels (Windows) + +on: + workflow_dispatch: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build_wheels: + runs-on: windows-latest + strategy: + matrix: + python-version: [ "3.8", "3.9", "3.10", "3.11" ] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install cibuildwheel + run: pip install cibuildwheel + - name: Build wheels + run: cibuildwheel --platform windows + env: + CIBW_BUILD: cp3*-win_amd64 + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels + path: wheelhouse/*.whl From 1f2b209034f05ddf8303f27d6f336f8ef8994a5e Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:22:04 +0200 Subject: [PATCH 02/12] Add branch to trigger build --- .github/workflows/build-wheels-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 2207bb8..9b482c7 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -6,9 +6,9 @@ name: Build wheels (Windows) on: workflow_dispatch: push: - branches: [ main, master ] + branches: [ main, master, test_ga_build ] pull_request: - branches: [ main, master ] + branches: [ main, master, test_ga_build ] jobs: build_wheels: From c88a273c7e12bb66bdb2411d12a7690509ab4d8b Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:30:02 +0200 Subject: [PATCH 03/12] Fix python version being built --- .github/workflows/build-wheels-windows.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 9b482c7..2d9c739 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -15,19 +15,21 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install cibuildwheel - run: pip install cibuildwheel - - name: Build wheels - run: cibuildwheel --platform windows + - name: Install build dependencies + run: pip install build + - name: Build wheels with cibuildwheel + uses: pypa/cibuildwheel@v2.23.3 + with: + output-dir: wheelhouse env: - CIBW_BUILD: cp3*-win_amd64 + CIBW_PLATFORM: windows - name: Upload wheels uses: actions/upload-artifact@v4 with: From 5d5ed3ccc4fa2033080ec5e0c8a43f47da98cbbf Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:35:17 +0200 Subject: [PATCH 04/12] WIP issue with python version --- .github/workflows/build-wheels-windows.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 2d9c739..987f044 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -13,23 +13,18 @@ on: jobs: build_wheels: runs-on: windows-latest - strategy: - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - - name: Install build dependencies - run: pip install build + python-version: '3.11' - name: Build wheels with cibuildwheel uses: pypa/cibuildwheel@v2.23.3 with: output-dir: wheelhouse env: - CIBW_PLATFORM: windows + CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 - name: Upload wheels uses: actions/upload-artifact@v4 with: From 3aaf99fffb3820f670cd45714e70b720d91141ab Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:43:27 +0200 Subject: [PATCH 05/12] Upload the resulting wheel individually --- .github/workflows/build-wheels-windows.yml | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 987f044..47a8b4b 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -25,8 +25,25 @@ jobs: output-dir: wheelhouse env: CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 - - name: Upload wheels + - name: Upload wheels for each Python version + run: | + for whl in wheelhouse/*.whl + set whl_name (basename $whl) + echo "Uploading $whl_name" + gh release upload temp-release $whl --clobber || true + echo "::group::Upload $whl_name" + echo "::endgroup::" + shell: bash + - name: Upload wheels as separate artifacts + run: | + for whl in wheelhouse/*.whl; do + whl_name=$(basename "$whl" .whl) + echo "Uploading $whl as $whl_name" + mkdir -p artifacts/$whl_name + cp "$whl" artifacts/$whl_name/ + done + shell: bash + - name: Upload all wheel artifacts uses: actions/upload-artifact@v4 with: - name: wheels - path: wheelhouse/*.whl + path: artifacts/*/*.whl From 1b02339b48ac32d10781ee57ed20a755be490940 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:46:23 +0200 Subject: [PATCH 06/12] Automatically make a release when push to main/master Will also upload the wheel to the new release. --- .github/workflows/build-wheels-windows.yml | 47 ++++++++++++---------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 47a8b4b..9c5a6ab 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -6,9 +6,9 @@ name: Build wheels (Windows) on: workflow_dispatch: push: - branches: [ main, master, test_ga_build ] + branches: [ main, master ] pull_request: - branches: [ main, master, test_ga_build ] + branches: [ main, master ] jobs: build_wheels: @@ -25,25 +25,28 @@ jobs: output-dir: wheelhouse env: CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 - - name: Upload wheels for each Python version + - name: Get version from git tag + id: get_version run: | - for whl in wheelhouse/*.whl - set whl_name (basename $whl) - echo "Uploading $whl_name" - gh release upload temp-release $whl --clobber || true - echo "::group::Upload $whl_name" - echo "::endgroup::" - shell: bash - - name: Upload wheels as separate artifacts - run: | - for whl in wheelhouse/*.whl; do - whl_name=$(basename "$whl" .whl) - echo "Uploading $whl as $whl_name" - mkdir -p artifacts/$whl_name - cp "$whl" artifacts/$whl_name/ - done - shell: bash - - name: Upload all wheel artifacts - uses: actions/upload-artifact@v4 + if [ "$GITHUB_REF_TYPE" = "tag" ]; then + VERSION=${GITHUB_REF#refs/tags/} + else + VERSION=$(git describe --tags --abbrev=0) + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Create GitHub Release + if: github.ref_type == 'tag' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.get_version.outputs.version }} + name: Release ${{ steps.get_version.outputs.version }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload wheels to GitHub Release + uses: softprops/action-gh-release@v2 with: - path: artifacts/*/*.whl + files: wheelhouse/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5571dbf0dd663a1a8b25e40ecc98dc4d06926259 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 11:56:42 +0200 Subject: [PATCH 07/12] Fix the call to use bash --- .github/workflows/build-wheels-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 9c5a6ab..f5b24be 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -27,6 +27,7 @@ jobs: CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 - name: Get version from git tag id: get_version + shell: bash run: | if [ "$GITHUB_REF_TYPE" = "tag" ]; then VERSION=${GITHUB_REF#refs/tags/} From c10493970fb7ec86997c4fab7463c56733fb1485 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 13:10:56 +0200 Subject: [PATCH 08/12] Mark the release as pre-release if there are no tags. Also uses commit-sha as release version for pre-release or tag number --- .github/workflows/build-wheels-windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index f5b24be..eaa6908 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -32,17 +32,17 @@ jobs: if [ "$GITHUB_REF_TYPE" = "tag" ]; then VERSION=${GITHUB_REF#refs/tags/} else - VERSION=$(git describe --tags --abbrev=0) + VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest-$(git rev-parse --short HEAD)") fi echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Create GitHub Release if: github.ref_type == 'tag' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' uses: softprops/action-gh-release@v2 with: - tag_name: ${{ steps.get_version.outputs.version }} - name: Release ${{ steps.get_version.outputs.version }} + tag_name: ${{ github.ref_type == 'tag' && github.ref_name || steps.get_version.outputs.version }} + name: Release ${{ github.ref_type == 'tag' && github.ref_name || steps.get_version.outputs.version }} draft: false - prerelease: false + prerelease: ${{ github.ref_type != 'tag' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload wheels to GitHub Release From 5005674082e61b49f7f89032483d2c5c807d2229 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 13:22:39 +0200 Subject: [PATCH 09/12] Change approach to get triggered only on release Wheels will be uploaded to the release --- .github/workflows/build-wheels-windows.yml | 25 ++++------------------ 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index eaa6908..4f3c31d 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -4,11 +4,8 @@ name: Build wheels (Windows) on: - workflow_dispatch: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] + release: + types: [ published ] jobs: build_wheels: @@ -25,24 +22,10 @@ jobs: output-dir: wheelhouse env: CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 - - name: Get version from git tag - id: get_version - shell: bash - run: | - if [ "$GITHUB_REF_TYPE" = "tag" ]; then - VERSION=${GITHUB_REF#refs/tags/} - else - VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest-$(git rev-parse --short HEAD)") - fi - echo "version=$VERSION" >> $GITHUB_OUTPUT - - name: Create GitHub Release - if: github.ref_type == 'tag' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' + - name: Upload wheels to GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ github.ref_type == 'tag' && github.ref_name || steps.get_version.outputs.version }} - name: Release ${{ github.ref_type == 'tag' && github.ref_name || steps.get_version.outputs.version }} - draft: false - prerelease: ${{ github.ref_type != 'tag' }} + files: wheelhouse/*.whl env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload wheels to GitHub Release From 2a9fc968dd611a02edc26fbf5946c96a053b74c0 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 14:02:53 +0200 Subject: [PATCH 10/12] Make it available for all python version above 3 --- .github/workflows/build-wheels-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 4f3c31d..5a78b3c 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -21,7 +21,7 @@ jobs: with: output-dir: wheelhouse env: - CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 + CIBW_BUILD: cp3*-win_amd64 - name: Upload wheels to GitHub Release uses: softprops/action-gh-release@v2 with: From b991a30303bc436e2d73ed208d3ecc6cc23c3da3 Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 14:11:27 +0200 Subject: [PATCH 11/12] Remove duplicate command --- .github/workflows/build-wheels-windows.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 5a78b3c..587c609 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -28,9 +28,3 @@ jobs: files: wheelhouse/*.whl env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload wheels to GitHub Release - uses: softprops/action-gh-release@v2 - with: - files: wheelhouse/*.whl - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1da87e7e2356c2b72e5e2a393b88a001c96be1aa Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Thu, 3 Jul 2025 14:15:27 +0200 Subject: [PATCH 12/12] Fix versions of python 3.13 is failing with Cpython changes, and therefore can't be built so fixing it to 3.9, 3.10, 3.11, 3.12 --- .github/workflows/build-wheels-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 587c609..e6265a7 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -21,7 +21,7 @@ jobs: with: output-dir: wheelhouse env: - CIBW_BUILD: cp3*-win_amd64 + CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 - name: Upload wheels to GitHub Release uses: softprops/action-gh-release@v2 with: