Skip to content

Add a manual release workflow - #21

Merged
Carreau merged 1 commit into
ipython:mainfrom
Carreau:autobump
Dec 3, 2026
Merged

Carreau merged 1 commit into
ipython:mainfrom
Carreau:autobump

Conversation

@Carreau

@Carreau Carreau commented Dec 3, 2026

Copy link
Copy Markdown
Member

release.yml is started from the Actions tab (or
gh workflow run release.yml -f version=X.Y.Z) on main. It:

  • validates the version (X.Y.Z, optionally aN/bN/rcN, no 'v' prefix) and that the tag does not exist yet
  • sets version in ipython_pygments_lexers/init.py
  • commits "Version number -> X.Y.Z" as github-actions[bot] and adds an annotated X.Y.Z tag, matching the existing conventions
  • pushes main and the tag atomically
  • starts publish.yml on the new tag

Pushes made with GITHUB_TOKEN do not trigger other workflows, so the tag push alone would not start publish.yml. workflow_dispatch is the exception, so publish.yml gains a workflow_dispatch trigger. Both its jobs only run on tag refs, and the tag/version check plus the pypi environment's tag rule still apply, so dispatching it on a branch cannot publish.

If main is protected against direct pushes, GitHub Actions must be allowed to bypass that rule for this to work.

release.yml is started from the Actions tab (or
`gh workflow run release.yml -f version=X.Y.Z`) on main. It:

- validates the version (X.Y.Z, optionally aN/bN/rcN, no 'v' prefix)
  and that the tag does not exist yet
- sets __version__ in ipython_pygments_lexers/__init__.py
- commits "Version number -> X.Y.Z" as github-actions[bot] and adds
  an annotated X.Y.Z tag, matching the existing conventions
- pushes main and the tag atomically
- starts publish.yml on the new tag

Pushes made with GITHUB_TOKEN do not trigger other workflows, so the
tag push alone would not start publish.yml. workflow_dispatch is the
exception, so publish.yml gains a workflow_dispatch trigger. Both its
jobs only run on tag refs, and the tag/__version__ check plus the pypi
environment's tag rule still apply, so dispatching it on a branch
cannot publish.

If main is protected against direct pushes, GitHub Actions must be
allowed to bypass that rule for this to work.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Carreau
Carreau merged commit bfabee5 into ipython:main Dec 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant