diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58d04cf..615b6ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,11 @@ on: - v* pull_request: +env: + UV_SYSTEM_PYTHON: 1 + jobs: - metadata_please-just-tests: + test: runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -18,9 +21,9 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] os: [macOS-latest, ubuntu-latest, windows-latest] exclude: - # macOS-latest are now on arm64 - - os: macOS-latest - python-version: "3.7" + # no amd64 3.7 + - python-version: "3.7" + os: macOS-latest steps: - name: Checkout @@ -29,35 +32,46 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true + - uses: astral-sh/setup-uv@v3 - name: Install run: | - python -m pip install --upgrade pip - pip install -U . + uv pip install -e .[test] - name: Test - run: python -m metadata_please.tests - - metadata_please: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - python-version: ["3.10", "3.11", "3.12"] - os: [macOS-latest, ubuntu-latest, windows-latest] + run: make test + - name: Lint + run: | + uv pip install -e .[test,dev] + make lint + if: ${{ matrix.python-version != '3.9' && matrix.python-version != '3.8' && matrix.python-version != '3.7' }} + build: + needs: test + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set Up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" + - uses: astral-sh/setup-uv@v3 - name: Install - run: | - python -m pip install --upgrade pip - make setup - pip install -U . - - name: Test - run: make test - - name: Lint - run: make lint + run: uv pip install build + - name: Build + run: python -m build + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: sdist + path: dist + + publish: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + with: + name: sdist + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1