Skip to content

Commit

Permalink
add a pypi config file
Browse files Browse the repository at this point in the history
  • Loading branch information
NoureldinYosri committed Jan 10, 2024
1 parent ad37cc0 commit d84fb2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Create PYPI config file
run: |
dev_tools/packaging/create_pypirc.sh
- name: Build and publish
run: |
export CIRQ_PRE_RELEASE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
[[ "$CIRQ_PRE_RELEASE_VERSION" =~ .*dev.* ]] && echo "Deploying dev version '$CIRQ_PRE_RELEASE_VERSION'" || (echo "not dev version"; exit 1)
out_dir="${PWD}/dist"
dev_tools/packaging/produce-package.sh ${out_dir} $CIRQ_PRE_RELEASE_VERSION
twine upload "${out_dir}/*" -u __token__ -p ${{ secrets.CIRQ_PYPI_TOKEN }}
twine upload "${out_dir}/*"
9 changes: 9 additions & 0 deletions dev_tools/packaging/create_pypirc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo """
[pypi]
username = __token__
password = ${{ secrets.CIRQ_PYPI_TOKEN }}
[testpypi]
username = __token__
password = ${{ secrets.CIRQ_TEST_PYPI_TOKEN }}
""" >> $HOME/.pypirc

0 comments on commit d84fb2c

Please sign in to comment.