tfc-v1.3.1 #45
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: Publish Wheels | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build_source_wheel: | |
| name: Build source wheel | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install libraries | |
| run: "sudo apt-get update && sudo apt-get install -y gcc g++" | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Checkout dependencies | |
| run: python -m pip install wheel setuptools numpy pybind11 mypy | |
| - name: Create source distribution | |
| run: python setup.py sdist | |
| - name: Checkout test dependencies | |
| run: python -m pip install pytest | |
| - name: Install source distribution | |
| run: pip install ./dist/tfc*.tar.gz | |
| - name: Test source distribution | |
| run: pytest tests | |
| - name: Upload source distribution | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: source_wheel | |
| path: ./dist/tfc*.tar.gz | |
| build_binary_wheels: | |
| name: Build binary wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest,ubuntu-latest,windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir dist | |
| - name: Upload binary wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}_binary_wheels | |
| path: ./dist/*.whl | |
| upload_wheels: | |
| name: Upload wheels to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [build_source_wheel, build_binary_wheels] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: source_wheel | |
| path: ./dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ubuntu-latest_binary_wheels | |
| path: ./dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-latest_binary_wheels | |
| path: ./dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-latest_binary_wheels | |
| path: ./dist | |
| - name: Publish package to PyPI test | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |