Try with .pypirc setup
This commit is contained in:
@ -54,36 +54,10 @@ jobs:
|
|||||||
- name: Build Wheels
|
- name: Build Wheels
|
||||||
run: |
|
run: |
|
||||||
python -m build .
|
python -m build .
|
||||||
|
- name: Write .pypirc file
|
||||||
pypi-publish:
|
|
||||||
name: Upload release to PyPI
|
|
||||||
needs: [build_wheel]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: [3.13.3]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python write_pypirc.py ${{secrets.PYPI_TOKEN}}
|
||||||
python -m pip install twine
|
-name: Upload to PyPI
|
||||||
- name: Upload
|
run: twine upload pipy dist/*
|
||||||
run: |
|
|
||||||
twine upload --username __token__ --password ${{secrets.PYPI_TOKEN}} --repository https://upload.pypi.org/legacy/ dist/*
|
|
||||||
|
|
||||||
# environment:
|
|
||||||
# name: pypi
|
|
||||||
# url: https://pypi.org/p/AMBER_ds4ms
|
|
||||||
# permissions:
|
|
||||||
# id-token: ${{secrets.PYPI_TOKEN}} # IMPORTANT: this permission is mandatory for trusted publishing
|
|
||||||
# steps:
|
|
||||||
# # retrieve your distributions here
|
|
||||||
#
|
|
||||||
# - name: Publish package distributions to PyPI
|
|
||||||
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
||||||
|
|
||||||
|
19
write_pypirc.py
Normal file
19
write_pypirc.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
def write_file(token):
|
||||||
|
|
||||||
|
with open('~/.pypirc','w') as f:
|
||||||
|
f.writelines(f"""
|
||||||
|
[distutils]
|
||||||
|
index-servers =
|
||||||
|
pypi
|
||||||
|
|
||||||
|
[pypi]
|
||||||
|
repository = https://upload.pypi.org/legacy/
|
||||||
|
username = __token__
|
||||||
|
password = {token}
|
||||||
|
""")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
token = sys.argv[1]
|
||||||
|
write_file(token)
|
Reference in New Issue
Block a user