Skip to content

Commit 044b158

Browse files
committed
Fix PyPI publish workflow failures
- Add skip-existing: true to prevent duplicate version upload failures - Disable attestations for TestPyPI to avoid attestation generation issues - Add continue-on-error for TestPyPI uploads to prevent workflow blocking - Improve version uniqueness by including GitHub run number - Add verbose output for better debugging
1 parent f5b883a commit 044b158

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
BASE_VERSION=$(grep -E '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
4848
TIMESTAMP=$(date +%Y%m%d%H%M%S)
4949
SHORT_SHA=${GITHUB_SHA:0:7}
50-
VERSION="${BASE_VERSION}.dev${TIMESTAMP}+${SHORT_SHA}"
50+
# Use GitHub run number to ensure unique versions
51+
VERSION="${BASE_VERSION}.dev${TIMESTAMP}+${SHORT_SHA}.${GITHUB_RUN_NUMBER}"
5152
echo "version=$VERSION" >> $GITHUB_OUTPUT
5253
echo "is_release=false" >> $GITHUB_OUTPUT
5354
echo "Building dev version: $VERSION"
@@ -90,8 +91,12 @@ jobs:
9091

9192
- name: Publish to TestPyPI
9293
uses: pypa/gh-action-pypi-publish@release/v1
94+
continue-on-error: true # Don't fail the workflow if TestPyPI upload fails
9395
with:
9496
repository-url: https://test.pypi.org/legacy/
97+
skip-existing: true
98+
verbose: true
99+
attestations: false # Disable attestations for TestPyPI to avoid issues
95100

96101
publish-to-pypi:
97102
name: Publish to PyPI
@@ -114,6 +119,9 @@ jobs:
114119

115120
- name: Publish to PyPI
116121
uses: pypa/gh-action-pypi-publish@release/v1
122+
with:
123+
skip-existing: true
124+
verbose: true
117125

118126
github-release:
119127
name: Create GitHub Release

0 commit comments

Comments
 (0)