Skip to content

Commit d79fdad

Browse files
authored
chore: release of 0.5.28
Merge pull request #36 from Logic-py/develop
2 parents 04783af + 4ad5627 commit d79fdad

3 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/generate_changelog.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
generate_categorized_changelog() {
4+
local previous_tag="$1"
5+
local git_log_command
6+
7+
if [ -n "$previous_tag" ]; then
8+
git_log_command="git log $previous_tag..HEAD"
9+
else
10+
git_log_command="git log"
11+
fi
12+
13+
echo "## What's Changed"
14+
15+
# Features
16+
echo "### 🚀 Features"
17+
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep "^* feat" || true
18+
19+
# Bug Fixes
20+
echo -e "\n### 🐛 Bug Fixes"
21+
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep "^* fix" || true
22+
23+
# Documentation
24+
echo -e "\n### 📚 Documentation"
25+
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep "^* docs" || true
26+
27+
# Other Changes
28+
echo -e "\n### 🔧 Other Changes"
29+
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep -v "^* feat\|^* fix\|^* docs" || true
30+
}
31+
32+
# Usage in workflow:
33+
# CHANGELOG=$(generate_categorized_changelog "$PREVIOUS_TAG")
34+
# echo "CHANGELOG<<EOF" >> $GITHUB_ENV
35+
# echo "$CHANGELOG" >> $GITHUB_ENV
36+
# echo "EOF" >> $GITHUB_ENV

.github/workflows/ci_check_release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,25 @@ jobs:
208208
echo "URL=${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.VERSION }}" >> $GITHUB_ENV
209209
fi
210210
211+
- name: Generate Changelog
212+
if: env.CREATE_RELEASE == 'true'
213+
id: changelog
214+
run: |
215+
if [ -n "${{ env.PREV_TAG }}" ]; then
216+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
217+
echo "## What's Changed" >> $GITHUB_ENV
218+
git log ${{ env.PREV_TAG }}..HEAD --pretty=format:"* %s (%h)" --reverse | while read -r line; do
219+
echo "* ${line}" >> $GITHUB_ENV
220+
done
221+
echo "EOF" >> $GITHUB_ENV
222+
else
223+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
224+
echo "## What's Changed" >> $GITHUB_ENV
225+
git log --pretty=format:"* %s (%h)" --reverse | while read -r line; do
226+
echo "* ${line}" >> $GITHUB_ENV
227+
done
228+
echo "
229+
211230
- name: Debug Release Notes
212231
if: env.CREATE_RELEASE == 'true'
213232
run: |
@@ -223,6 +242,7 @@ jobs:
223242
tag_name: ${{ env.VERSION }}
224243
name: ${{ env.VERSION }}
225244
body: |
245+
${{ env.CHANGELOG }}
226246
**Full Changelog**: ${{ env.URL }}
227247
draft: false
228248
prerelease: false

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "python-template"
3-
version = "0.5.27"
3+
version = "0.5.28"
44
description = "Used to templatize python projects."
55
authors = ["Loïc Motheu <lmotheu@gmail.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)