feature: add script for release notes
This commit is contained in:
parent
ac62e47083
commit
783bfb47dc
2 changed files with 41 additions and 0 deletions
|
|
@ -2,6 +2,23 @@
|
|||
|
||||
Best practices and guidelines for writing code documentation.
|
||||
|
||||
## Release Notes
|
||||
|
||||
The idea is to get rather automated release notes. To have this as easy as possible, we need:
|
||||
|
||||
- key words for the kind of change we applied:
|
||||
- `feature:` - for newly added functionality
|
||||
- `fix:` - for bugfixes
|
||||
- `nonotes:` - for git commits we don't want to see in the release notes
|
||||
|
||||
- tags for each version, we will output only the change log from the last and second last tag
|
||||
|
||||
[resources/scripts/release-notes.bash](resources/scripts/release-notes.bash) is an example bash script to generate the release notes. You can run it with the following command:
|
||||
|
||||
```bash
|
||||
bash resources/scripts/release-notes.bash
|
||||
```
|
||||
|
||||
## PlantUML
|
||||
|
||||
Create png images from PlantUML files using the following command:
|
||||
|
|
|
|||
24
resources/scripts/release-notes.bash
Normal file
24
resources/scripts/release-notes.bash
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Get tags sorted by creation date
|
||||
tags=$(git tag --sort=creatordate)
|
||||
|
||||
# Convert tags into an array using IFS
|
||||
IFS=$'\n' tagArray=("$tags")
|
||||
|
||||
# Get the number of tags
|
||||
len=${#tagArray[@]}
|
||||
|
||||
# Extract the last and second last tags based on length
|
||||
latestTag=${tagArray[$len-1]}
|
||||
secondLastTag=${tagArray[$len-2]}
|
||||
|
||||
# Check if the tags are assigned correctly
|
||||
if [ -z "$latestTag" ] || [ -z "$secondLastTag" ]; then
|
||||
echo "Not enough tags found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate release notes from commits between the two latest tags
|
||||
echo "Release Notes from $secondLastTag to $latestTag:"
|
||||
git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep -E 'feature:|fix:' | sort | uniq | sed -e 's/feature:/\nNew Feature:/g' -e 's/fix:/\nFix:/g'
|
||||
Loading…
Add table
Add a link
Reference in a new issue