Skip to content

Commit f2c820c

Browse files
Fix for pushing to pypi
1 parent b2e35c8 commit f2c820c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,19 @@ runs:
148148
TWINE_USERNAME: ${{ inputs.pypi-user }}
149149
TWINE_PASSWORD: ${{ inputs.pypi-token }}
150150
shell: bash
151+
# If I understand correctly then default PyPI is a bit weird in that it has a different upload URL.
151152
run: |
152153
if [ "${TWINE_PASSWORD}" == "false" ]; then
153154
unset TWINE_USERNAME
154155
unset TWINE_PASSWORD
155156
fi
156157
python -m pip install twine
157-
python -m twine upload --repository-url ${{ inputs.pypi-repository-url }} --verbose --non-interactive dist/*
158+
if [ ${{ inputs.pypi-repository-url }} == https://pypi.org/ ]; then
159+
export REPO_URL=https://upload.pypi.org/legacy/
160+
else
161+
export REPO_URL=${{ inputs.pypi-repository-url }}
162+
fi
163+
python -m twine upload --repository-url $REPO_URL --verbose --non-interactive dist/*
158164
159165
- name: Tag
160166
if: (steps.get-versions.outputs.new-version == 'true') && (steps.test-sdist.outputs.result == 'true') && (steps.test-bdist-wheel.outputs.result == 'true')

0 commit comments

Comments
 (0)