From 6918d2a78df2dd31842651ea8f568d16a9099996 Mon Sep 17 00:00:00 2001 From: Daniel Young <9008637+YoungDan@users.noreply.github.com> Date: Fri, 29 May 2026 14:39:49 +0200 Subject: [PATCH] ci: add workflow_dispatch to crates-publish GITHUB_TOKEN-created releases do not fan out release events to other workflows; allow operators to publish manually after a release cut. --- .github/workflows/crates-publish.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/crates-publish.yml b/.github/workflows/crates-publish.yml index 8425612..d008d64 100644 --- a/.github/workflows/crates-publish.yml +++ b/.github/workflows/crates-publish.yml @@ -11,6 +11,12 @@ name: Crates.io Publish on: release: types: [published] + workflow_dispatch: + inputs: + tag: + description: Release tag to publish (e.g. v1.0.0). Must match Cargo.toml version. + required: true + type: string permissions: id-token: write @@ -20,7 +26,7 @@ jobs: publish: name: cargo publish # Skip prereleases (e.g. v0.1.0-rc.1) — crates.io publishes are permanent. - if: ${{ github.event.release.prerelease == false }} + if: ${{ github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false }} runs-on: ubuntu-latest steps: - name: Checkout @@ -33,7 +39,11 @@ jobs: shell: bash run: | set -euo pipefail - TAG="${{ github.event.release.tag_name }}" + if [ -n "${{ github.event.release.tag_name }}" ]; then + TAG="${{ github.event.release.tag_name }}" + else + TAG="${{ inputs.tag }}" + fi CRATE_VERSION=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/') EXPECTED="${TAG#v}" if [ "${CRATE_VERSION}" != "${EXPECTED}" ]; then