Skip to content

Commit 845e27f

Browse files
committed
Put releases back on merges to main
Restores the guard 7ddac38 replaced with `if: false`, so merging to main bumps the patch version, uploads to PyPI with the existing PYPI_API_TOKEN secret, and pushes the bump commit plus its tag. The guard matters: the same workflow also fires on pull requests and a nightly schedule, and an unguarded job would cut a release from both. release.yml keeps building, smoke-testing and attesting every v* tag — only its upload is switched off, so the tag stable.yml pushes cannot start a second upload of a version PyPI already has. Going back to tag-driven releases means registering a PyPI trusted publisher for release.yml and swapping the two conditions.
1 parent 99f62a7 commit 845e27f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ jobs:
5656

5757
publish:
5858
needs: build
59+
# Publishing happens on merge to main (stable.yml), so this path stays
60+
# off: the tags stable.yml pushes would otherwise start a second upload
61+
# of a version PyPI already has. The build job above still runs on every
62+
# v* tag — it verifies the tag matches pyproject, smoke-tests the wheel
63+
# and attests provenance. To go back to tag-driven releases, register a
64+
# PyPI trusted publisher for release.yml, drop this condition, and put
65+
# stable.yml's publish job back behind `if: ${{ false }}`.
66+
if: ${{ false }}
5967
runs-on: ubuntu-latest
6068
environment:
6169
name: pypi

.github/workflows/stable.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,12 @@ jobs:
118118

119119
publish:
120120
needs: test
121-
# Publishing moved to release.yml: immutable v* tags + Trusted Publishing.
122-
if: ${{ false }}
121+
# Releases ride on merges to main: this job bumps the patch version,
122+
# uploads to PyPI with the PYPI_API_TOKEN secret, then pushes the bump
123+
# commit (marked [skip ci]) and its v* tag. The guard is what keeps it
124+
# off pull requests and the nightly schedule, which the same workflow
125+
# also triggers on — without it every PR would cut a release.
126+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
123127
runs-on: ubuntu-latest
124128
permissions:
125129
contents: write

0 commit comments

Comments
 (0)