Skip to content

Commit e7a180d

Browse files
committed
fix: publish with uv token username
1 parent abcbf1f commit e7a180d

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

bin/release.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,15 @@ publish_artifacts() {
287287
if curl -fsSL "https://pypi.org/pypi/${PYPI_PACKAGE}/json" | jq -e --arg version "${version}" '.releases[$version] | length > 0' >/dev/null 2>&1; then
288288
echo "${PYPI_PACKAGE} ${version} already published on PyPI"
289289
else
290+
if [[ "${#artifacts[@]}" -eq 0 ]]; then
291+
echo "Missing build artifacts for ${PYPI_PACKAGE}==${version}" >&2
292+
return 1
293+
fi
294+
290295
if [[ -n "${pypi_token}" ]]; then
291-
if [[ "${#artifacts[@]}" -eq 0 ]]; then
292-
echo "Missing build artifacts for ${PYPI_PACKAGE}==${version}" >&2
293-
return 1
294-
fi
295296
UV_PUBLISH_TOKEN="${pypi_token}" uv publish --username=__token__ "${artifacts[@]}"
296-
elif [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
297-
if [[ "${#artifacts[@]}" -eq 0 ]]; then
298-
echo "Missing build artifacts for ${PYPI_PACKAGE}==${version}" >&2
299-
return 1
300-
fi
301-
uv publish --trusted-publishing always "${artifacts[@]}"
302297
else
303-
echo "Missing PyPI credentials: set UV_PUBLISH_TOKEN or PYPI_TOKEN" >&2
304-
return 1
298+
uv publish --username=__token__ "${artifacts[@]}"
305299
fi
306300
fi
307301

0 commit comments

Comments
 (0)