aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-test-publish.yml
blob: 9c7bf41da52fb89b088252b13282c80729896877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Test, Build, and Publish

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - "**"

jobs:
  test-build-publish:
    runs-on: ubuntu-latest
    name: Test, Build and Publish

    steps:
      - name: Checkout repo
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.11"

      - name: Install uv
        run: pip install uv

      - name: Run tests
        run: python test.py

      - name: Build package
        run: uv build

      - name: Publish to PyPI
        if: github.ref == 'refs/heads/main'
        run: uv publish
        env:
          UV_PUBLISH_TOKEN: ${{ secrets.UV_PYPI_TOKEN }}