|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | publish: |
12 | | - name: Publish release to PyPi |
| 12 | + name: Publish ${{ matrix.variant }} release to PyPi |
13 | 13 | runs-on: ubuntu-latest |
14 | 14 | strategy: |
| 15 | + fail-fast: false |
| 16 | + # Ensures the full release publishes before the lite one. |
| 17 | + max-parallel: 1 |
15 | 18 | matrix: |
16 | | - python-version: [ "3.11" ] |
| 19 | + variant: [ full, lite ] |
| 20 | + env: |
| 21 | + PYTHON_VERSION: "3.13" |
17 | 22 | steps: |
18 | 23 | - uses: actions/checkout@v6 |
19 | 24 |
|
20 | | - - name: Set up Python ${{ matrix.python-version }} |
| 25 | + - name: Set up Python ${{ env.PYTHON_VERSION }} |
21 | 26 | uses: actions/setup-python@v6 |
22 | 27 | with: |
23 | | - python-version: ${{ matrix.python-version }} |
| 28 | + python-version: ${{ env.PYTHON_VERSION }} |
24 | 29 |
|
25 | 30 | - name: Cache dependencies |
26 | 31 | uses: actions/cache@v5 |
|
31 | 36 | ${{ runner.os }}-build- |
32 | 37 |
|
33 | 38 | - name: Install dependencies |
34 | | - run: python -m pip install -e '.[build]' |
| 39 | + run: | |
| 40 | + if [ "${{ matrix.variant }}" = "lite" ]; then |
| 41 | + python -m pip install toml |
| 42 | + fi |
| 43 | + python -m pip install -e '.[build]' |
| 44 | +
|
| 45 | + - name: Generate lite TOML |
| 46 | + if: matrix.variant == 'lite' |
| 47 | + run: | |
| 48 | + python scripts/generate_lite_toml.py |
| 49 | + cp pyproject-lite.toml pyproject.toml |
35 | 50 |
|
36 | 51 | - name: Build |
37 | 52 | run: | |
|
49 | 64 | run: twine upload --disable-progress-bar --repository testpypi ./dist/* |
50 | 65 |
|
51 | 66 | - name: Upload |
| 67 | + if: startsWith(github.ref, 'refs/tags/') |
52 | 68 | env: |
53 | 69 | TWINE_NON_INTERACTIVE: "1" |
54 | 70 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
|
0 commit comments