File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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."
You can’t perform that action at this time.
0 commit comments