Skip to content

Commit 8c6b696

Browse files
committed
ci: remove TestPyPI publish from PRs to avoid version conflicts, only publish to PyPI from main/releases
1 parent 76b4ee0 commit 8c6b696

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: Publish Python Package
22

33
# Trigger on:
4-
# - pull requests targeting main (publish to TestPyPI for validation before merge)
54
# - pushes to main (publish to PyPI after merge)
6-
# - published GitHub Releases (keep existing behavior for canonical releases)
5+
# - published GitHub Releases (publish to PyPI for versioned releases)
76
on:
8-
pull_request:
9-
branches: [main]
107
push:
118
branches: [main]
129
release:
@@ -44,32 +41,6 @@ jobs:
4441
name: python-package-distributions
4542
path: dist/
4643

47-
# Publish from pull requests to main -> TestPyPI
48-
publish_testpypi:
49-
name: Publish to TestPyPI (PR to main)
50-
runs-on: ubuntu-latest
51-
needs: build_sdist_and_wheel
52-
# Only run for pull request events targeting main
53-
if: github.event_name == 'pull_request' && github.base_ref == 'main'
54-
environment: testpypi
55-
permissions:
56-
id-token: write
57-
contents: read
58-
59-
steps:
60-
- name: Download dists
61-
uses: actions/download-artifact@v4
62-
with:
63-
name: python-package-distributions
64-
path: dist/
65-
66-
- name: Publish package distributions to TestPyPI
67-
uses: pypa/gh-action-pypi-publish@release/v1
68-
with:
69-
# repository-url directs upload to TestPyPI
70-
repository-url: https://test.pypi.org/legacy/
71-
skip-existing: true
72-
7344
# Publish from pushes to main OR when a Release is published -> Production PyPI
7445
publish_pypi:
7546
name: Publish to PyPI (main branch or GitHub Release)

0 commit comments

Comments
 (0)