Update build system #248
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: Python Build | |
| "on": | |
| push: | |
| branches: ["main"] | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| - "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+" | |
| pull_request: | |
| jobs: | |
| from-sdist: | |
| name: python source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.5" | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| python-version-file: "pyproject.toml" | |
| - name: Install pyssht | |
| run: uv sync --all-extras --dev | |
| - name: run pytest | |
| run: uv run pytest tests/test_pyssht.py | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: macos-latest | |
| steps: | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.5" | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Build wheels | |
| run: uv build --wheel | |
| - name: install wheel | |
| run: "pip install dist/*.whl" | |
| - name: run pytests | |
| run: uv pip install pytest && pytest tests | |
| publication: | |
| name: publish to pypi | |
| if: ${{ startsWith(github.ref, 'refs/tags') }} | |
| runs-on: macos-latest | |
| steps: | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.5" | |
| - name: Publish distribution 📦 to Test PyPI | |
| if: ${{ github.ref != 'refs/tags/v1.5.2' }} | |
| run: "uv publish --publish-url https://test.pypi.org/legacy --token ${{ secrets.TEST_PYPI_TOKEN }}" | |
| - name: Publish distribution 📦 to PyPI | |
| if: ${{ github.ref == 'refs/tags/v1.5.2' }} | |
| run: "uv publish --token ${{ secrets.TEST_PYPI_TOKEN }}" |