Skip to content

Commit 7a0aebe

Browse files
committed
ci(test): vadility test
1 parent ff628ee commit 7a0aebe

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Test PyPI Token"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions: write-all
7+
8+
jobs:
9+
test_pypi_token:
10+
runs-on: ubuntu-latest
11+
environment: release
12+
steps:
13+
- name: "Test PyPI Token with twine"
14+
env:
15+
TWINE_USERNAME: "__token__"
16+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
17+
run: |
18+
echo "[distutils]" > ~/.pypirc
19+
echo "index-servers = pypi" >> ~/.pypirc
20+
echo "[pypi]" >> ~/.pypirc
21+
echo "username = $TWINE_USERNAME" >> ~/.pypirc
22+
echo "password = $TWINE_PASSWORD" >> ~/.pypirc
23+
python -m pip install --upgrade pip twine
24+
# Create a dummy package
25+
mkdir testpkg && cd testpkg
26+
echo "from setuptools import setup; setup(name='testpkg', version='0.0.1')" > setup.py
27+
python setup.py sdist
28+
# Try to upload to PyPI (will fail if token is invalid)
29+
twine upload --repository pypi dist/* --non-interactive --skip-existing || echo "PyPI token test completed."

0 commit comments

Comments
 (0)