From bf8fcd21d79fa83403b3768eba3b7a56ee727ab6 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 13 Nov 2025 12:39:20 +0000 Subject: [PATCH] Add dual trigger support (tag push + workflow_dispatch) --- .github/workflows/release.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84ba3df38..7198d0fe6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,9 @@ name: Release -# Trigger: workflow_dispatch +# Trigger: workflow_dispatch and tag push on: + push: + tags: + - 'v*.*.*' workflow_dispatch: inputs: version: @@ -23,8 +26,14 @@ jobs: - name: Extract version id: extract run: | - VERSION="${{ inputs.version }}" - TAG="v${VERSION}" + # Handle both tag push and workflow_dispatch + if [ "${{ github.event_name }}" = "push" ]; then + TAG="${GITHUB_REF#refs/tags/}" + VERSION="${TAG#v}" + else + VERSION="${{ inputs.version }}" + TAG="v${VERSION}" + fi echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "version=${VERSION}" >> $GITHUB_OUTPUT echo "Version: ${VERSION}, Tag: ${TAG}" @@ -318,11 +327,18 @@ jobs: run: | VERSION="${{ needs.extract-version.outputs.version }}" - echo "Using Claude-generated release notes from workflow input" - # Save release notes to file NOTES_FILE=$(mktemp) - printf "%s\n" "$RELEASE_NOTES_INPUT" > "$NOTES_FILE" + + if [ -n "$RELEASE_NOTES_INPUT" ]; then + echo "Using Claude-generated release notes from workflow input" + printf "%s\n" "$RELEASE_NOTES_INPUT" > "$NOTES_FILE" + else + echo "Tag-triggered release - using placeholder notes" + echo "Release $VERSION" > "$NOTES_FILE" + echo "" >> "$NOTES_FILE" + echo "See commit history for changes." >> "$NOTES_FILE" + fi # Add installation instructions cat >> "$NOTES_FILE" << EOF