mirror of
https://github.com/lifting-bits/remill
synced 2026-06-21 13:56:07 +00:00
CI: Use single packaging job, add changelog support (#491)
This commit is contained in:
Executable
+30
@@ -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 $?
|
||||
Reference in New Issue
Block a user