File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,12 +271,21 @@ create_release() {
271271publish_artifacts () {
272272 local version=" $1 "
273273 local pypi_token=" ${UV_PUBLISH_TOKEN:- ${PYPI_TOKEN:- ${PYPI_PAT_SECRET:- } } } "
274+ local artifact_prefix=" ${PYPI_PACKAGE// -/ _} "
275+ local artifacts=(" ${WORKSPACE_DIR} /dist/${PYPI_PACKAGE} -${version} " * )
276+ if [[ " ${artifact_prefix} " != " ${PYPI_PACKAGE} " ]]; then
277+ artifacts+=(" ${WORKSPACE_DIR} /dist/${artifact_prefix} -${version} " * )
278+ fi
274279
275280 if curl -fsSL " https://pypi.org/pypi/${PYPI_PACKAGE} /json" | jq -e --arg version " ${version} " ' .releases[$version] | length > 0' > /dev/null 2>&1 ; then
276281 echo " ${PYPI_PACKAGE} ${version} already published on PyPI"
277282 else
278283 if [[ -n " ${pypi_token} " ]]; then
279- UV_PUBLISH_TOKEN=" ${pypi_token} " uv publish --username=__token__ dist/*
284+ if [[ ! -e " ${artifacts[0]} " ]]; then
285+ echo " Missing build artifacts for ${PYPI_PACKAGE} ==${version} in ${WORKSPACE_DIR} /dist" >&2
286+ return 1
287+ fi
288+ UV_PUBLISH_TOKEN=" ${pypi_token} " uv publish --username=__token__ " ${artifacts[@]} "
280289 else
281290 echo " Missing PyPI credentials: set UV_PUBLISH_TOKEN or PYPI_TOKEN" >&2
282291 return 1
You can’t perform that action at this time.
0 commit comments