Skip to content

Commit b2e6c1d

Browse files
Update publish.yml
This updated workflow: Adds proper caching for pip Cleans any previous build artifacts Displays the version from pyproject.toml before building Adds debugging steps to show what files are being created Adds the skip-existing option to avoid errors when a file with the same version already exists
1 parent a9abf17 commit b2e6c1d

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,35 @@ jobs:
1212
uses: actions/setup-python@v4
1313
with:
1414
python-version: '3.12'
15+
cache: 'pip'
16+
cache-dependency-path: '.github/workflows/publish.yml'
1517

1618
- name: Install dependencies
1719
run: |
1820
python -m pip install --upgrade pip
1921
pip install build
20-
22+
23+
- name: Clean previous builds
24+
run: |
25+
rm -rf dist/ build/ *.egg-info/
26+
27+
- name: Verify version before build
28+
run: |
29+
echo "==== pyproject.toml version ===="
30+
grep "version" pyproject.toml
31+
2132
- name: Build package
2233
run: python -m build
23-
34+
35+
- name: Debug package version
36+
run: |
37+
echo "==== Built distribution files ===="
38+
ls -la dist/
39+
echo "==== Checking tarball contents ===="
40+
tar -tzf dist/*.tar.gz | grep -E 'version|VERSION'
41+
2442
- name: Publish to PyPI
2543
uses: pypa/gh-action-pypi-publish@release/v1
2644
with:
27-
attestations: true
45+
attestations: true
46+
skip-existing: true

0 commit comments

Comments
 (0)