Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the pypirc generation script safer #6410

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
CIRQ_PYPI_TOKEN: ${{ secrets.CIRQ_PYPI_TOKEN }}
CIRQ_TEST_PYPI_TOKEN: ${{ secrets.CIRQ_TEST_PYPI_TOKEN }}
run: |
dev_tools/packaging/create_pypirc.sh
dev_tools/packaging/create_pypirc.sh > ~/.pypirc
- name: Build and publish
run: |
export CIRQ_PRE_RELEASE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
Expand Down
13 changes: 7 additions & 6 deletions dev_tools/packaging/create_pypirc.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!bin/bash
#!/bin/bash

# Create default pypi config file with token authentication.
# Output default pypi config file with token authentication.
# refrence: https://packaging.python.org/en/latest/specifications/pypirc/#common-configurations
echo """

echo "\
[pypi]
username = __token__
password = ${CIRQ_PYPI_TOKEN}
password = ${CIRQ_PYPI_TOKEN:?}

[testpypi]
username = __token__
password = ${CIRQ_TEST_PYPI_TOKEN}
""" >> $HOME/.pypirc
password = ${CIRQ_TEST_PYPI_TOKEN:?}
"