diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a16643f..b9cef95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,10 @@ on: description: 'Version number (e.g., 4.30.0)' required: true type: string + release_notes: + description: 'Release notes (markdown) - generated by Claude' + required: true + type: string jobs: extract-version: @@ -32,8 +36,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - fetch-depth: 0 # Need full history to check tags - name: Ensure VERSION file matches requested version run: | @@ -46,18 +48,6 @@ jobs: fi echo "✓ VERSION file matches requested version ($REQUESTED_VERSION)" - - name: Check if tag already exists - run: | - TAG="${{ needs.extract-version.outputs.tag }}" - if git rev-parse "$TAG" >/dev/null 2>&1; then - echo "✓ Tag $TAG already exists (will use existing tag annotation)" - else - echo "::error::Tag $TAG does not exist. Please create an annotated tag with release notes first:" - echo "::error:: git tag -a $TAG -F /tmp/release_notes_${{ needs.extract-version.outputs.version }}.md" - echo "::error:: git push origin $TAG" - exit 1 - fi - preflight-tests: needs: version-guard runs-on: ubuntu-latest @@ -321,29 +311,18 @@ jobs: echo "Building release ${{ needs.extract-version.outputs.tag }}..." ./scripts/build-release.sh ${{ needs.extract-version.outputs.version }} - - name: Extract release notes from tag annotation + - name: Prepare release notes id: generate_notes + env: + RELEASE_NOTES_INPUT: ${{ inputs.release_notes }} run: | - TAG="${{ needs.extract-version.outputs.tag }}" VERSION="${{ needs.extract-version.outputs.version }}" - echo "Reading release notes from tag annotation..." + echo "Using Claude-generated release notes from workflow input" - # Check if tag has an annotation (release notes from Claude) - TAG_MESSAGE=$(git tag -l --format='%(contents)' "${TAG}") - - if [ -z "$TAG_MESSAGE" ] || [ "$TAG_MESSAGE" = "" ]; then - echo "::error::Tag ${TAG} has no annotation. Release notes must be provided by Claude." - echo "::error::Tags must be created with: git tag -a ${TAG} -F /tmp/release_notes_${VERSION}.md" - echo "::error::This ensures Claude writes user-focused, semantic changelog instead of raw commits." - exit 1 - fi - - echo "✓ Found release notes in tag annotation" - - # Save tag annotation to file + # Save release notes to file NOTES_FILE=$(mktemp) - echo "$TAG_MESSAGE" > "$NOTES_FILE" + printf "%s\n" "$RELEASE_NOTES_INPUT" > "$NOTES_FILE" # Add installation instructions cat >> "$NOTES_FILE" << EOF