Skip to content

Commit 47da3ff

Browse files
feat: Update release workflow and README
- Update release workflow to include changelog and commit history - Make README banners linkable
1 parent 79923b3 commit 47da3ff

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

.github/workflows/create.release.for.tag.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,42 @@ jobs:
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Fetch all history for all tags
1921

2022
- name: Set current tag
2123
run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
2224

25+
- name: Get previous tag
26+
id: previoustag
27+
run: |
28+
# Get the latest tag that is not the current tag
29+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null)
30+
if [ $? -ne 0 ]; then
31+
echo "No previous tag found. Using first commit."
32+
# Use the hash of the very first commit if no previous tag is found
33+
PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
34+
fi
35+
echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_ENV
36+
echo "Previous tag: $PREVIOUS_TAG"
37+
2338
- name: Generate Release Notes
2439
env:
2540
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
PREVIOUS_TAG: ${{ env.previous_tag }}
2642
run: |
27-
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"
43+
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"
44+
45+
# Generate changelog
46+
CHANGELOG=$(git log --pretty=format:"* %s (%h)" $PREVIOUS_TAG..$CURRENT_TAG)
47+
48+
if [ -n "$CHANGELOG" ]; then
49+
RELEASE_BODY="${RELEASE_BODY}**Full Changelog**:\n\n${CHANGELOG}\n\n"
50+
fi
51+
52+
# Add link to compare with previous version
53+
RELEASE_BODY="${RELEASE_BODY}See all commits since last release: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${CURRENT_TAG}"
54+
2855
echo "RELEASENOTES<<EOF" >> $GITHUB_ENV
2956
echo -e "$RELEASE_BODY" >> $GITHUB_ENV
3057
echo "EOF" >> $GITHUB_ENV

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Run LLM prompts straight from your shell, and more
88

99
[▶️ Get Started in 30 seconds](#quickstart)[💬 Join Discord][discord-invite]
1010

11-
![Release](https://img.shields.io/github/v/release/attogram/ollama-bash-lib?style=flat)
12-
![License](https://img.shields.io/github/license/attogram/ollama-bash-lib?style=flat)
11+
[![Release](https://img.shields.io/github/v/release/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/releases)
12+
[![License](https://img.shields.io/github/license/attogram/ollama-bash-lib?style=flat)](./LICENSE)
1313
![Bash ≥3.2](https://img.shields.io/badge/bash-%3E=3.2-blue?style=flat)
14-
![GitHub commit activity](https://img.shields.io/github/commit-activity/t/attogram/ollama-bash-lib?style=flat)
15-
![GitHub stars](https://img.shields.io/github/stars/attogram/ollama-bash-lib?style=flat)
16-
![GitHub watchers](https://img.shields.io/github/watchers/attogram/ollama-bash-lib?style=flat)
17-
![Forks](https://img.shields.io/github/forks/attogram/ollama-bash-lib?style=flat)
18-
![Issues](https://img.shields.io/github/issues/attogram/ollama-bash-lib?style=flat)
14+
[![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/)
15+
[![GitHub stars](https://img.shields.io/github/stars/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/stargazers)
16+
[![GitHub watchers](https://img.shields.io/github/watchers/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/watchers)
17+
[![Forks](https://img.shields.io/github/forks/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/forks)
18+
[![Issues](https://img.shields.io/github/issues/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/issues)
1919

2020
[Quickstart](#quickstart) -
2121
[Usage](#usage) -

0 commit comments

Comments
 (0)