diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4263e09 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +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 }} \ No newline at end of file