#45 Migrate to a pyproject.toml file and add wheel builds. #36
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: PyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - auto-release | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| name: Build distributions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.9" | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| - name: Build sdist and wheel | |
| run: | | |
| python -m build | |
| - name: Check the sdist installs and imports | |
| run: | | |
| mkdir -p test-sdist | |
| cd test-sdist | |
| python -m venv venv-sdist | |
| venv-sdist/bin/python -m pip install ../dist/logical_unification-*.tar.gz | |
| - name: Check the wheel installs and imports | |
| run: | | |
| mkdir -p test-wheel | |
| cd test-wheel | |
| python -m venv venv-wheel | |
| venv-wheel/bin/python -m pip install ../dist/logical_unification-*.whl | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist/* | |
| upload_pypi: | |
| name: Upload distributions to PyPI on release | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| name: artifact | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.pypi_secret }} |