Skip to content

Commit 65c09c3

Browse files
committed
CI: split TestPyPI uploads for svv and svv-accelerated with separate secrets; add token checks and skip-existing
1 parent 4bcfb2e commit 65c09c3

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/test-upload.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,29 @@ jobs:
9292
merge-multiple: true
9393
- name: Install twine
9494
run: pip install --upgrade pip && pip install twine
95-
- name: Upload both wheels to TestPyPI
96-
run: twine upload --repository testpypi dist/*
95+
- name: Validate TestPyPI token (svv)
96+
if: ${{ hashFiles('dist/svv-*-py3-none-any.whl') != '' || hashFiles('dist/svv-*.tar.gz') != '' }}
97+
run: |
98+
if [ -z "${{ secrets.TEST_PYPI_PASSWORD_SVV }}" ]; then
99+
echo "::error title=Missing secret::The repository secret 'TEST_PYPI_PASSWORD_SVV' is not configured. Set it to a TestPyPI API token with access to the 'svv' project.";
100+
exit 1;
101+
fi
102+
- name: Upload base package (svv) to TestPyPI
103+
if: ${{ hashFiles('dist/svv-*-py3-none-any.whl') != '' || hashFiles('dist/svv-*.tar.gz') != '' }}
104+
run: twine upload --non-interactive --skip-existing --verbose --repository testpypi dist/svv-*-py3-none-any.whl dist/svv-*.tar.gz
105+
env:
106+
TWINE_USERNAME: __token__
107+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD_SVV }}
108+
- name: Validate TestPyPI token (svv-accelerated)
109+
if: ${{ hashFiles('dist/svv-accelerated-*.whl') != '' }}
110+
run: |
111+
if [ -z "${{ secrets.TEST_PYPI_PASSWORD_ACCEL }}" ]; then
112+
echo "::error title=Missing secret::The repository secret 'TEST_PYPI_PASSWORD_ACCEL' is not configured. Set it to a TestPyPI API token with access to the 'svv-accelerated' project.";
113+
exit 1;
114+
fi
115+
- name: Upload accelerated wheels (svv-accelerated) to TestPyPI
116+
if: ${{ hashFiles('dist/svv-accelerated-*.whl') != '' }}
117+
run: twine upload --non-interactive --skip-existing --verbose --repository testpypi dist/svv-accelerated-*.whl
97118
env:
98119
TWINE_USERNAME: __token__
99-
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
120+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD_ACCEL }}

0 commit comments

Comments
 (0)