name: build on: push: branches: pull_request: branches: permissions: contents: read jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] python-version: ["pypy3.11", "3.9", "3.10", "3.11", "3.12", "3.13"] env: UV_PYTHON: ${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install package and development dependencies run: uv sync --all-extras --dev - name: Test with pytest run: | uv run pytest deploy: name: Deploy environment: Deployment needs: test runs-on: ubuntu-latest if: github.ref=='refs/heads/main' && github.event_name!='pull_request' permissions: contents: write id-token: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" - name: Check release id: check_release run: | python -m pip install autopub[github] autopub check - name: Publish if: ${{ steps.check_release.outputs.autopub_release=='true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | autopub prepare autopub commit autopub build autopub githubrelease - name: Upload package to PyPI if: ${{ steps.check_release.outputs.autopub_release=='true' }} uses: pypa/gh-action-pypi-publish@release/v1