From 47da3ff0a676f45be13b343480e34ad186e4f203 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 23 Aug 2025 10:24:25 +0000 Subject: [PATCH 1/2] feat: Update release workflow and README - Update release workflow to include changelog and commit history - Make README banners linkable --- .github/workflows/create.release.for.tag.yml | 29 +++++++++++++++++++- README.md | 14 +++++----- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create.release.for.tag.yml b/.github/workflows/create.release.for.tag.yml index b7b7a0a..e751389 100644 --- a/.github/workflows/create.release.for.tag.yml +++ b/.github/workflows/create.release.for.tag.yml @@ -16,15 +16,42 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags - name: Set current tag run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Get previous tag + id: previoustag + run: | + # Get the latest tag that is not the current tag + PREVIOUS_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null) + if [ $? -ne 0 ]; then + echo "No previous tag found. Using first commit." + # Use the hash of the very first commit if no previous tag is found + PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD) + fi + echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_ENV + echo "Previous tag: $PREVIOUS_TAG" + - name: Generate Release Notes env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PREVIOUS_TAG: ${{ env.previous_tag }} run: | - RELEASE_BODY="Ollama Bash Lib $CURRENT_TAG\n\nA Bash Library for Ollama\n\nRun LLM prompts straight from your shell, and more\n\nRepo: https://github.com/${{ github.repository }}\n" + RELEASE_BODY="**Ollama Bash Lib $CURRENT_TAG**\n\nA Bash Library for Ollama\n\nRun LLM prompts straight from your shell, and more\n\nRepo: https://github.com/${{ github.repository }}\n\n" + + # Generate changelog + CHANGELOG=$(git log --pretty=format:"* %s (%h)" $PREVIOUS_TAG..$CURRENT_TAG) + + if [ -n "$CHANGELOG" ]; then + RELEASE_BODY="${RELEASE_BODY}**Full Changelog**:\n\n${CHANGELOG}\n\n" + fi + + # Add link to compare with previous version + RELEASE_BODY="${RELEASE_BODY}See all commits since last release: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${CURRENT_TAG}" + echo "RELEASENOTES<> $GITHUB_ENV echo -e "$RELEASE_BODY" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV diff --git a/README.md b/README.md index 29eb525..58bd68d 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ Run LLM prompts straight from your shell, and more [▶️ Get Started in 30 seconds](#quickstart) • [💬 Join Discord][discord-invite] -![Release](https://img.shields.io/github/v/release/attogram/ollama-bash-lib?style=flat) -![License](https://img.shields.io/github/license/attogram/ollama-bash-lib?style=flat) +[![Release](https://img.shields.io/github/v/release/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/releases) +[![License](https://img.shields.io/github/license/attogram/ollama-bash-lib?style=flat)](./LICENSE) ![Bash ≥3.2](https://img.shields.io/badge/bash-%3E=3.2-blue?style=flat) -![GitHub commit activity](https://img.shields.io/github/commit-activity/t/attogram/ollama-bash-lib?style=flat) -![GitHub stars](https://img.shields.io/github/stars/attogram/ollama-bash-lib?style=flat) -![GitHub watchers](https://img.shields.io/github/watchers/attogram/ollama-bash-lib?style=flat) -![Forks](https://img.shields.io/github/forks/attogram/ollama-bash-lib?style=flat) -![Issues](https://img.shields.io/github/issues/attogram/ollama-bash-lib?style=flat) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/t/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/commits/main/) +[![GitHub stars](https://img.shields.io/github/stars/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/stargazers) +[![GitHub watchers](https://img.shields.io/github/watchers/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/watchers) +[![Forks](https://img.shields.io/github/forks/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/forks) +[![Issues](https://img.shields.io/github/issues/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/issues) [Quickstart](#quickstart) - [Usage](#usage) - From cde2e63632a5085413c1aaf724db43a8ab8d8b98 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 23 Aug 2025 10:27:26 +0000 Subject: [PATCH 2/2] fix: Use HEREDOC for more readable release description This changes the release workflow to use a HEREDOC for the main release body text. This makes the description much easier for humans to edit, as it avoids a single long line with ` ` newline characters. --- .github/workflows/create.release.for.tag.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create.release.for.tag.yml b/.github/workflows/create.release.for.tag.yml index e751389..cde4a0b 100644 --- a/.github/workflows/create.release.for.tag.yml +++ b/.github/workflows/create.release.for.tag.yml @@ -40,7 +40,16 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PREVIOUS_TAG: ${{ env.previous_tag }} run: | - RELEASE_BODY="**Ollama Bash Lib $CURRENT_TAG**\n\nA Bash Library for Ollama\n\nRun LLM prompts straight from your shell, and more\n\nRepo: https://github.com/${{ github.repository }}\n\n" + RELEASE_BODY=$(cat <