Update build_and_publish_to_pypi_windows.yml #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Workflow to build binary wheels for Windows | |
| name: Build python wheels - Windows | |
| on: | |
| #workflow_dispatch | |
| push: | |
| branches: | |
| - 'GenTen-Windows' | |
| jobs: | |
| build-wheels: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set reusable strings | |
| id: strings | |
| shell: bash | |
| run: | | |
| echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
| openblas_lib="${{ github.workspace }}/openblas/lib/libopenblas.lib" | |
| openblas_lib_unix=$(echo "$openblas_lib" | sed 's/\\/\//g') | |
| echo "openblas_lib=$openblas_lib_unix" >> "$GITHUB_OUTPUT" | |
| #- name: Install OpenBLAS | |
| #run: | | |
| #mkdir openblas | |
| #cd openblas | |
| #curl -o openblas.zip -L --ssl-no-revoke --url https://sourceforge.net/projects/openblas/files/v0.3.29/OpenBLAS-0.3.29_x64.zip | |
| #unzip openblas.zip | |
| #- name: Add OpenBLAS to path so Windows can find its DLLs | |
| #shell: bash | |
| #run: echo "${{ github.workspace }}/openblas/bin" >> "$GITHUB_PATH" | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.0.0 | |
| with: | |
| output-dir: dist | |
| env: | |
| CIBW_BUILD: cp312-win_amd64 | |
| CIBW_BUILD_VERBOSITY: 1 | |
| CIBW_BEFORE_ALL_WINDOWS: > | |
| mkdir openblas && | |
| cd openblas && | |
| curl -o openblas.zip -L --ssl-no-revoke --url https://sourceforge.net/projects/openblas/files/v0.3.29/OpenBLAS-0.3.29_x64.zip && | |
| unzip openblas.zip && | |
| set PATH=${{ github.workspace }}/openblas/bin:${PATH} | |
| CIBW_CONFIG_SETTINGS_WINDOWS: "cmake.args=-DLAPACK_LIBS=${{ steps.strings.outputs.openblas_lib }};-DPYGENTEN_SERIAL=ON;-DENABLE_PYTHON_EMBED=OFF;-DENABLE_REAL_TIME_CLOCK=OFF" | |
| CIBW_ENVIRONMENT_WINDOWS: GENTEN_DLL_PATH=${{ github.workspace }}/openblas/bin | |
| CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" | |
| CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" | |
| # CIBW_TEST_REQUIRES: pytest pyttb | |
| # CIBW_TEST_COMMAND: > | |
| # cd {package} && | |
| # pytest python/test | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists-${{ matrix.os }} | |
| path: dist/ | |
| #pypi-publish: | |
| #runs-on: windows-latest | |
| #needs: | |
| #- build-wheels | |
| #permissions: | |
| #id-token: write | |
| #environment: | |
| #name: pypi | |
| #url: https://pypi.org/project/pygenten/ | |
| #steps: | |
| #- name: Retrieve release distributions | |
| # uses: actions/download-artifact@v4 | |
| #with: | |
| #name: release-dists-windows-latest | |
| #path: dist/ | |
| #- name: Publish release distributions to PyPI | |
| #uses: pypa/gh-action-pypi-publish@release/v1 | |
| #with: | |
| #skip-existing: true | |