Skip to content

Commit 55ccf46

Browse files
committed
fix: allow trusted PyPI publishing in actions
1 parent 1a26bf6 commit 55ccf46

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

bin/release.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ publish_artifacts() {
286286
return 1
287287
fi
288288
UV_PUBLISH_TOKEN="${pypi_token}" uv publish --username=__token__ "${artifacts[@]}"
289+
elif [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
290+
if [[ ! -e "${artifacts[0]}" ]]; then
291+
echo "Missing build artifacts for ${PYPI_PACKAGE}==${version} in ${WORKSPACE_DIR}/dist" >&2
292+
return 1
293+
fi
294+
uv publish --trusted-publishing always "${artifacts[@]}"
289295
else
290296
echo "Missing PyPI credentials: set UV_PUBLISH_TOKEN or PYPI_TOKEN" >&2
291297
return 1

0 commit comments

Comments
 (0)