name: Generate Release Notes on: push: tags: - 'v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc. permissions: contents: write # Needed to create/update releases jobs: release-notes: name: Generate and publish release notes runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v5 with: fetch-depth: 0 # Fetch all history for git-cliff - name: Get previous tag id: previoustag run: | PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") echo "previous_tag=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT echo "Previous tag: ${PREVIOUS_TAG}" - name: Install git-cliff run: | wget https://github.com/orhun/git-cliff/releases/download/v2.4.0/git-cliff-2.4.0-x86_64-unknown-linux-gnu.tar.gz tar -xzf git-cliff-2.4.0-x86_64-unknown-linux-gnu.tar.gz sudo mv git-cliff-2.4.0/git-cliff /usr/local/bin/ git-cliff --version - name: Generate release notes id: release_notes run: | FROM_TAG="${{ steps.previoustag.outputs.previous_tag }}" TO_TAG="${GITHUB_REF#refs/tags/}" echo "Generating release notes from ${FROM_TAG} to ${TO_TAG}" # Use our script with git-cliff backend (AI disabled in CI) # git-cliff will handle filtering via cliff.toml USE_AI=false ./scripts/generate-release-notes "${FROM_TAG}" "${TO_TAG}" > release-notes.md # Output for GitHub Actions { echo 'notes<> $GITHUB_OUTPUT - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: body: ${{ steps.release_notes.outputs.notes }} draft: false prerelease: false generate_release_notes: false # We provide our own env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Summary run: | echo "✅ Release notes generated and published!" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Tag:** ${GITHUB_REF#refs/tags/}" >> $GITHUB_STEP_SUMMARY echo "**Previous tag:** ${{ steps.previoustag.outputs.previous_tag }}" >> $GITHUB_STEP_SUMMARY