Release Notes #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Notes | |
| on: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g., v0.3.3)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release-notes: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # full history for tag detection and diff stats | |
| - name: Resolve tag | |
| id: tag | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| # ── Surface 1: GitHub Release body + step summary ────────── | |
| - name: Generate release notes (markdown) | |
| uses: ./ | |
| id: markdown | |
| with: | |
| template: release-notes | |
| data: auto | |
| data-format: github-prs | |
| head-ref: ${{ steps.tag.outputs.tag }} | |
| release-tag: ${{ steps.tag.outputs.tag }} | |
| post-to: release,step-summary | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # ── Surface 2: Terminal-formatted release asset ──────────── | |
| - name: Generate release notes (terminal) | |
| uses: ./ | |
| with: | |
| template: release-notes-terminal | |
| data: ${{ steps.markdown.outputs.data-file }} | |
| data-format: json | |
| render-mode: terminal | |
| release-tag: ${{ steps.tag.outputs.tag }} | |
| asset-name: RELEASE-NOTES.txt | |
| post-to: release-asset | |
| install: 'false' | |
| python-version: 'skip' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # ── Surface 3: Compact notes for changelog ───────────────── | |
| - name: Generate release notes (compact) | |
| uses: ./ | |
| id: compact | |
| with: | |
| template: release-notes-compact | |
| data: ${{ steps.markdown.outputs.data-file }} | |
| data-format: json | |
| release-tag: ${{ steps.tag.outputs.tag }} | |
| post-to: changelog | |
| install: 'false' | |
| python-version: 'skip' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit changelog updates | |
| if: steps.compact.outcome == 'success' | |
| run: | | |
| if git diff --quiet CHANGELOG.md 2>/dev/null; then | |
| echo "No changelog changes to commit." | |
| else | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add CHANGELOG.md | |
| git commit -m "docs: update CHANGELOG for ${{ steps.tag.outputs.tag }}" | |
| git push | |
| fi |