Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ on:
push:
tags:
- "v*"
# Manual trigger for republishing a specific tag if the original push-on-tag
# run failed and is now too old to be re-run via the GitHub UI (#1790).
# ``ref`` should be a tag name like ``v4.11.1``.
workflow_dispatch:
inputs:
ref:
description: "Tag to republish (e.g., v4.11.1)"
required: true
type: string
Comment thread
bearomorphism marked this conversation as resolved.

jobs:
deploy:
Expand All @@ -14,10 +23,19 @@ jobs:
id-token: write
contents: read
steps:
- name: Validate dispatch ref is a tag
if: github.event_name == 'workflow_dispatch'
env:
TAG: ${{ github.event.inputs.ref }}
run: |
if ! git ls-remote --tags "https://github.com/${GITHUB_REPOSITORY}" "refs/tags/${TAG}" | grep -q .; then
echo "::error::Dispatch ref '${TAG}' is not an existing tag"
exit 1
fi
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', github.event.inputs.ref) || github.ref }}
- name: Set up Python
uses: astral-sh/setup-uv@v7
- name: Build
Expand Down
Loading