1 package khisto python #28
Workflow file for this run
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
| name: pip packaging | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| python_repository: | |
| description: python repository | |
| type: choice | |
| default: None # no publishing to any Package Index by default | |
| options: [None, test.pypi, pypi] | |
| push: | |
| tags: ['*'] | |
| pull_request: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build-wheel: | |
| name: Build wheel | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-15-intel, macos-15] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Load Visual C++ Environment Variables (Windows) | |
| if: runner.os == 'Windows' | |
| shell: cmd | |
| run: | | |
| call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" | |
| set >> %GITHUB_ENV% | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| - name: install Python | |
| uses: actions/setup-python@v5 | |
| - name: Test built wheel | |
| run: | | |
| pip install --find-links=wheelhouse khisto | |
| pip install pytest>=8.3 pytest-cov>=6 pytest-xdist>=3.6 pytest-sugar>=1.0 | |
| pytest tests/ | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pkg-wheel-${{ matrix.os }} | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| if: github.ref_type == 'tag' && github.repository_owner == 'KhiopsML' && inputs.python_repository != 'None' | |
| name: Publish to Test.PyPI.org or PyPI.org | |
| needs: [build-wheel] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: ${{ inputs.python_repository}} | |
| url: https://${{ inputs.python_repository}}.org/p/khisto | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| pattern: pkg-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true |