Scripts to generate AUTHORS and ChangeLog (#1101)
Originated by @KangLin in #1097 Create scripts that generate ChangeLog and Authors - can be combined/called by other scripts during build process Scripts are idempotent: running them multiple times should not change anything They do not commit or tag - up to the author/reviewer to make those changes The lists are generated in Markdown compatible format (so that we can change those files to .md in the future) NOTES: - Authors file is generated in alphabetical order, disregarding specific contributions - ChangeLog file is generated in order of commits, omitting bot commits (dependabot) Co-authored-by: Kang Lin <kl222@126.com>
This commit is contained in:
parent
fe46a71da7
commit
54842274d3
14
authors.sh
Executable file
14
authors.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
SOURCE_DIR=`pwd`
|
||||
|
||||
# Generate AUTHORS
|
||||
echo "Thanks to the following contributors (in alphabetical order):" > ${SOURCE_DIR}/AUTHORS
|
||||
echo "" >> ${SOURCE_DIR}/AUTHORS
|
||||
echo "`git log --pretty=format:'- %an <%ae>' | grep -v dependabot | sort | uniq`" >> ${SOURCE_DIR}/AUTHORS
|
||||
echo "" >> ${SOURCE_DIR}/AUTHORS
|
||||
echo "Use the following command to query the author's commit:" >> ${SOURCE_DIR}/AUTHORS
|
||||
echo " git log --author='author'" >> ${SOURCE_DIR}/AUTHORS
|
||||
echo "Or see [ChangeLog](ChangeLog)" >> ${SOURCE_DIR}/AUTHORS
|
||||
48
release.sh
Executable file
48
release.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
#! Author: Kang Lin <kl222@126.com>
|
||||
|
||||
set -e
|
||||
|
||||
SOURCE_DIR=`pwd`
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
VERSION=$1
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
MESSAGE=$2
|
||||
fi
|
||||
PRE_TAG=`git tag --sort=-creatordate | grep -v -E "upstream|docker|debian" | head -n 1`
|
||||
echo "Current version: $PRE_TAG. The version to will be set: $1 $MESSAGE"
|
||||
else
|
||||
echo "usage: $0 release_version [release_message]"
|
||||
echo " release_version format: [v][0-9].[0-9].[0-9]"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ -z "${MESSAGE}" ]; then
|
||||
MESSAGE="Release $1"
|
||||
else
|
||||
MESSAGE="Release $1: ${MESSAGE}"
|
||||
fi
|
||||
|
||||
VERSION=$1
|
||||
|
||||
sed -i "s/SET(BUILD_VERSION \".*)/SET(BUILD_VERSION \"${VERSION}\")/g" ${SOURCE_DIR}/CMakeLists.txt
|
||||
sed -i "s/#define TURN_SERVER_VERSION .*/#define TURN_SERVER_VERSION \"${VERSION}\"/g" ${SOURCE_DIR}/src/ns_turn_defs.h
|
||||
|
||||
# Generate ChangeLog
|
||||
if [ -f ${SOURCE_DIR}/ChangeLog ]; then
|
||||
mv ${SOURCE_DIR}/ChangeLog ${SOURCE_DIR}/ChangeLog.tmp
|
||||
fi
|
||||
|
||||
echo "$MESSAGE" > ${SOURCE_DIR}/ChangeLog
|
||||
echo "" >> ${SOURCE_DIR}/ChangeLog
|
||||
echo "Changelist:" >> ${SOURCE_DIR}/ChangeLog
|
||||
echo "`git log --pretty=format:'- %s (%an <%ae>)' ${PRE_TAG}..HEAD | grep -v dependabot`" >> ${SOURCE_DIR}/ChangeLog
|
||||
echo "" >> ${SOURCE_DIR}/ChangeLog
|
||||
echo "Contributors:" >> ${SOURCE_DIR}/ChangeLog
|
||||
echo "`git log --pretty=format:'- %an <%ae>' ${PRE_TAG}..HEAD|sort|uniq`" >> ${SOURCE_DIR}/ChangeLog
|
||||
echo "" >> ${SOURCE_DIR}/ChangeLog
|
||||
|
||||
cat ${SOURCE_DIR}/ChangeLog.tmp >> ${SOURCE_DIR}/ChangeLog
|
||||
rm ${SOURCE_DIR}/ChangeLog.tmp
|
||||
Loading…
Reference in New Issue
Block a user