Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/workflows/create.release.for.tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,51 @@ 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=$(cat <<EOF
**Ollama Bash Lib $CURRENT_TAG**

A Bash Library for Ollama

Run LLM prompts straight from your shell, and more

Repo: https://github.com/${{ github.repository }}
EOF
)

# 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<<EOF" >> $GITHUB_ENV
echo -e "$RELEASE_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) -
Expand Down