Skip to content

Commit

Permalink
chore: use api tokens for pypi deploys (#14464)
Browse files Browse the repository at this point in the history
* chore: use api tokens for pypi deploys

* enforce latest pip

* perhaps latest pipenv
  • Loading branch information
sfoster1 authored Feb 9, 2024
1 parent 3bf933a commit fd0f7aa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/actions/python/pypi-deploy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
fi
fi
status=0
CI=1 QUIET=1 BUILD_NUMBER=${OT_BUILD} make -C ${{ inputs.project }} clean deploy twine_repository_url=${{ inputs.repository_url }} pypi_username=opentrons pypi_password=${{ inputs.password }} || status=$?
CI=1 QUIET=1 BUILD_NUMBER=${OT_BUILD} make -C ${{ inputs.project }} clean deploy twine_repository_url=${{ inputs.repository_url }} pypi_username=__token__ pypi_password=${{ inputs.password }} || status=$?
if [[ ${status} != 0 ]] && [[ ${{ inputs.repository_url }} =~ "test.pypi.org" ]]; then
echo "upload failures allowed to test pypi"
exit 0
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/python/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ runs:
- shell: bash
run: |
npm install --global [email protected]
$OT_PYTHON -m pip install pipenv==2023.11.15
$OT_PYTHON -m pip install --upgrade pip
$OT_PYTHON -m pip install pipenv==2023.12.1
- shell: bash
run: 'make -C ${{ inputs.project }} setup'
4 changes: 2 additions & 2 deletions .github/workflows/api-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ jobs:
with:
project: 'api'
repository_url: 'https://test.pypi.org/legacy/'
password: '${{ secrets.OT_TEST_PYPI_PASSWORD }}'
password: '${{ secrets.TEST_PYPI_DEPLOY_TOKEN_OPENTRONS }}'
- if: startsWith(env.OT_TAG, 'v')
name: 'upload to real pypi'
uses: './.github/actions/python/pypi-deploy'
with:
project: 'api'
repository_url: 'https://upload.pypi.org/legacy/'
password: '${{ secrets.OT_PYPI_PASSWORD }}'
password: '${{ secrets.PYPI_DEPLOY_TOKEN_OPENTRONS }}'
4 changes: 2 additions & 2 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ jobs:
with:
project: 'shared-data/python'
repository_url: 'https://test.pypi.org/legacy/'
password: '${{ secrets.OT_TEST_PYPI_PASSWORD }}'
password: '${{ secrets.TEST_PYPI_DEPLOY_TOKEN_OPENTRONS_SHARED_DATA }}'
- if: startsWith(env.OT_TAG, 'v')
name: 'upload to pypi'
uses: './.github/actions/python/pypi-deploy'
with:
project: 'shared-data/python'
repository_url: 'https://upload.pypi.org/legacy/'
password: '${{ secrets.OT_PYPI_PASSWORD }}'
password: '${{ secrets.PYPI_DEPLOY_TOKEN_OPENTRONS_SHARED_DATA }}'

publish-switch:
runs-on: 'ubuntu-latest'
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ PYTHON_SETUP_TARGETS := $(addsuffix -py-setup, $(PYTHON_DIRS))

.PHONY: setup-py
setup-py:
$(OT_PYTHON) -m pip install pipenv==2023.11.15
$(OT_PYTHON) -m pip install --upgrade pip
$(OT_PYTHON) -m pip install pipenv==2023.12.1
$(MAKE) $(PYTHON_SETUP_TARGETS)


Expand Down

0 comments on commit fd0f7aa

Please sign in to comment.