66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
name: Example
|
|
|
|
|
|
on:
|
|
push
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: run-tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version:
|
|
- "3.10"
|
|
- "3.11"
|
|
- "3.12"
|
|
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v5
|
|
with:
|
|
# Install a specific version of uv.
|
|
version: "0.6.14"
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras --dev
|
|
|
|
- name: Run tests
|
|
run: uv run poe tests
|
|
|
|
publish:
|
|
name: publish
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
needs: [test]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v5
|
|
with:
|
|
# Install a specific version of uv.
|
|
version: "0.6.14"
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
|
|
- name: Set up Python
|
|
run: uv python install
|
|
|
|
- name: Build
|
|
run: uv build
|
|
|
|
- name: Publish
|
|
run: uv publish -t ${{ secrets.PYPI_TOKEN }} |