Skip to content

Commit 162e8a4

Browse files
add proper publish action
1 parent b654417 commit 162e8a4

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/_publish-code.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ 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+
# Ensures the full release publishes before the lite one.
17+
max-parallel: 1
1518
matrix:
16-
python-version: [ "3.11" ]
19+
variant: [ full, lite ]
20+
env:
21+
PYTHON_VERSION: "3.13"
1722
steps:
1823
- uses: actions/checkout@v6
1924

20-
- name: Set up Python ${{ matrix.python-version }}
25+
- name: Set up Python ${{ env.PYTHON_VERSION }}
2126
uses: actions/setup-python@v6
2227
with:
23-
python-version: ${{ matrix.python-version }}
28+
python-version: ${{ env.PYTHON_VERSION }}
2429

2530
- name: Cache dependencies
2631
uses: actions/cache@v5
@@ -31,7 +36,17 @@ jobs:
3136
${{ runner.os }}-build-
3237
3338
- 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
3550
3651
- name: Build
3752
run: |
@@ -49,6 +64,7 @@ jobs:
4964
run: twine upload --disable-progress-bar --repository testpypi ./dist/*
5065

5166
- name: Upload
67+
if: startsWith(github.ref, 'refs/tags/')
5268
env:
5369
TWINE_NON_INTERACTIVE: "1"
5470
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

0 commit comments

Comments
 (0)