Skip to content

Commit 6111f93

Browse files
add proper publish action
1 parent b654417 commit 6111f93

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

.github/workflows/_publish-code.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ on:
99

1010
jobs:
1111
publish:
12-
name: Publish release to PyPi
12+
name: Publish ${{ matrix.variant }} release to PyPi
1313
runs-on: ubuntu-latest
1414
strategy:
15+
fail-fast: false
16+
max-parallel: 1
1517
matrix:
16-
python-version: [ "3.11" ]
18+
variant: [ full, lite ]
19+
env:
20+
PYTHON_VERSION: "3.13"
1721
steps:
1822
- uses: actions/checkout@v6
1923

20-
- name: Set up Python ${{ matrix.python-version }}
24+
- name: Set up Python ${{ env.PYTHON_VERSION }}
2125
uses: actions/setup-python@v6
2226
with:
23-
python-version: ${{ matrix.python-version }}
27+
python-version: ${{ env.PYTHON_VERSION }}
2428

2529
- name: Cache dependencies
2630
uses: actions/cache@v5
@@ -31,7 +35,17 @@ jobs:
3135
${{ runner.os }}-build-
3236
3337
- name: Install dependencies
34-
run: python -m pip install -e '.[build]'
38+
run: |
39+
if [ "${{ matrix.variant }}" = "lite" ]; then
40+
python -m pip install toml
41+
fi
42+
python -m pip install -e '.[build]'
43+
44+
- name: Generate lite TOML
45+
if: matrix.variant == 'lite'
46+
run: |
47+
python scripts/generate_lite_toml.py
48+
cp pyproject-lite.toml pyproject.toml
3549
3650
- name: Build
3751
run: |
@@ -49,6 +63,7 @@ jobs:
4963
run: twine upload --disable-progress-bar --repository testpypi ./dist/*
5064

5165
- name: Upload
66+
if: startsWith(github.ref, 'refs/tags/')
5267
env:
5368
TWINE_NON_INTERACTIVE: "1"
5469
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

0 commit comments

Comments
 (0)