Ask the PyPI index whether the version is there, since twine may not
build / build (push) Successful in 10m53s
build / build (push) Successful in 10m53s
twine's --skip-existing is not a client-side flag: it asks the repository whether it supports the feature, and Gitea's PyPI registry does not advertise it, so the upload fails with UnsupportedConfiguration before it starts. Check the simple index for the version instead -- the same check-then-publish shape the npm step already uses.
This commit is contained in:
@@ -171,9 +171,20 @@ jobs:
|
||||
run: |
|
||||
python -m pip install --upgrade build twine
|
||||
python -m build
|
||||
python -m twine upload --skip-existing \
|
||||
--repository-url "https://${GITEA_HOST}/api/packages/${GITEA_OWNER}/pypi" \
|
||||
dist/*
|
||||
# twine's --skip-existing is refused outright here: it asks the
|
||||
# repository whether it supports the feature and Gitea's PyPI
|
||||
# registry does not advertise it ("UnsupportedConfiguration"). Ask
|
||||
# the simple index instead, the same check-then-publish shape the
|
||||
# npm step uses.
|
||||
INDEX="https://${GITEA_HOST}/api/packages/${GITEA_OWNER}/pypi/simple/pulumi-dokploy/"
|
||||
if curl -sf --user "${GITEA_OWNER}:${TWINE_PASSWORD}" "$INDEX" \
|
||||
| grep -qE "pulumi_dokploy-${VERSION}[-.]"; then
|
||||
echo "pulumi-dokploy ${VERSION} is already published"
|
||||
else
|
||||
python -m twine upload \
|
||||
--repository-url "https://${GITEA_HOST}/api/packages/${GITEA_OWNER}/pypi" \
|
||||
dist/*
|
||||
fi
|
||||
|
||||
- name: Publish to the Gitea NuGet registry
|
||||
working-directory: pulumi-dokploy/sdk/dotnet
|
||||
|
||||
Reference in New Issue
Block a user