Skip to content

Commit

Permalink
release log has truncated commits and changelog has full
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Feb 16, 2021
1 parent d039c74 commit 4aa4cdc
Show file tree
Hide file tree
Showing 6 changed files with 3,551 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# Check 2 most recent tags, overwrites
- name: Tagged Release Notes
run: |
workflow/scripts/notes_commits.sh `git tag | tail -n2 | head -n1` `git tag | tail -n1` > release-notes.md
workflow/scripts/notes_release.sh `git tag | tail -n2 | head -n1` `git tag | tail -n1` > release-notes.md
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
Expand Down
1,777 changes: 1,771 additions & 6 deletions CHANGELOG.md

Large diffs are not rendered by default.

1,765 changes: 1,765 additions & 0 deletions docs/releases/Changelog_0-2-1.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion workflow/scripts/changelog_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ TAGS=`git tag | tr '\n' ' '`
HEAD="HEAD"
SCRIPTS_DIR="workflow/scripts"
NOTES_DIR="docs/releases"
# -1 will impose no restrictions on the number of commits
MAX_COMMITS=-1

NEW_VER=$1


#------------------------------
# Parse Versions
arr_ver=($BASE $TAGS $HEAD)
Expand Down Expand Up @@ -50,6 +53,6 @@ for ((i=1; i<${num_ver}; i++));
do
cur_ver=${arr_ver[$i]}
echo "Comparing $cur_ver to $prev_ver"
${SCRIPTS_DIR}/notes_release.sh ${cur_ver} ${prev_ver} >> CHANGELOG.md
${SCRIPTS_DIR}/notes_release.sh ${cur_ver} ${prev_ver} $MAX_COMMITS >> CHANGELOG.md
prev_ver=$cur_ver
done
8 changes: 5 additions & 3 deletions workflow/scripts/notes_commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ NEW_VER=$2
BASE="https://github.com/ktmeaton/plague-phylogeography/commit"

# Default number of commits to print is 20
# Use -1 to print infinite
MAX_COMMITS=$3
MAX_COMMITS="${MAX_COMMITS:=20}"

Expand All @@ -14,12 +15,13 @@ i=0;
git log --pretty=oneline --abbrev-commit ${OLD_VER}..${NEW_VER} | \
while read line;
do
# Increment commit counter
i=`expr $i + 1`
if [[ $i -ge $MAX_COMMITS ]]; then
if [[ $i -ge $MAX_COMMITS && $MAX_COMMITS != -1 ]]; then
break
fi
hash=`echo $line | cut -d " " -f 1`
msg=`echo $line | sed "s/$hash //g"`
echo -e "* [\`\`\`$hash\`\`\`]($BASE/$hash) $msg";

# Increment commit counter
i=`expr $i + 1`
done;
7 changes: 5 additions & 2 deletions workflow/scripts/notes_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# First ="a58299c51609ad"
OLD_VER=$1
NEW_VER=$2
# if MAX_COMMITS not specified, will use default in notes_commits script
MAX_COMMITS=$3

BASE="https://github.com/ktmeaton/ActionRPG/commit"
SCRIPTS_DIR=workflow/scripts
NOTES_DIR=docs/releases
Expand Down Expand Up @@ -44,7 +47,7 @@ patch=${arr_ver[2]}
if [[ $NEW_VER == "HEAD" ]]; then
rel="Development"
else
rel="Release $minor.$patch"
rel="Release v$major.$minor.$patch"
fi

# ----------------
Expand Down Expand Up @@ -80,5 +83,5 @@ fi
# Commits Header
echo "### Commits"
echo
${SCRIPTS_DIR}/notes_commits.sh ${OLD_VER} ${NEW_VER}
${SCRIPTS_DIR}/notes_commits.sh ${OLD_VER} ${NEW_VER} ${MAX_COMMITS}
echo

0 comments on commit 4aa4cdc

Please sign in to comment.