-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Use single packaging job, add changelog support (#491)
- Loading branch information
1 parent
6db8551
commit 76f8be1
Showing
2 changed files
with
47 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
PROJECT_NAME="remill" | ||
|
||
main() { | ||
if [[ $# != 1 ]] ; then | ||
printf "Usage:\n\tgenerate_changelog.sh <path/to/changelog/file.md>\n" | ||
return 1 | ||
fi | ||
|
||
local output_path="${1}" | ||
local current_version="$(git describe --tags --always)" | ||
local previous_version="$(git describe --tags --always --abbrev=0 ${current_version}^)" | ||
|
||
echo "Current version: ${current_version}" | ||
echo "Previous version: ${previous_version}" | ||
echo "Output file: ${output_path}" | ||
|
||
printf "# Changelog\n\n" > "${output_path}" | ||
printf "The following are the changes that happened between versions ${previous_version} and ${current_version}\n\n" >> "${output_path}" | ||
|
||
git log ${previous_version}...${current_version} \ | ||
--pretty=format:" * [%h](http://github.com/lifting-bits/${PROJECT_NAME}/commit/%H) - %s" \ | ||
--reverse | grep -v 'Merge branch' >> "${output_path}" | ||
|
||
return 0 | ||
} | ||
|
||
main $@ | ||
exit $? |