Update build system #253
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_uv: | ||
| name: python source distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - 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-file: "pyproject.toml" | ||
| - name: Install pyssht | ||
| run: uv sync --all-extras --dev | ||
| - name: run pytest | ||
| run: uv run pytest tests/test_pyssht.py | ||
| from_sdist: | ||
| name: python source distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - 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-file: "pyproject.toml" | ||
| - name: Build sdist | ||
| run: uv build --sdist | ||
| - name: install wheel | ||
| run: | ||
| - uv venv | ||
|
Check failure on line 51 in .github/workflows/python.yml
|
||
| - "uv pip install dist/pyssht-*.tar.gz" | ||
| - name: run pytests | ||
| run: uv pip install pytest && uv run pytest tests | ||
| build_wheels: | ||
| name: Build wheels on ${{ matrix.os }} | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - 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-file: "pyproject.toml" | ||
| - name: Build wheels | ||
| run: uv build --wheel | ||
| - name: install wheel | ||
| run: | ||
| - uv venv | ||
| - "uv pip install dist/*.whl" | ||
| - name: run pytests | ||
| run: uv pip install pytest && uv run 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 }}" | ||