加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
release 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
Grovkillen 提交于 2018-05-02 22:33 . Spelling correction
#!/bin/bash
set -e
NEW="$1"
[ "$NEW" != "" ] || exit 1
echo "Creating release $NEW"
if git describe "$NEW" &>/dev/null; then
echo "Release already exists"
exit 1
fi
NEWBASE=`echo "$NEW"|cut -f1 -d'-'`
PREV=`git tag --sort=creatordate|grep "^$NEWBASE"|tail -1`
############## update Release_notes.txt
NOTES="dist/Release_notes.txt"
echo "-------------------------------------------------" > "$NOTES.new"
echo "Changes in release $NEW (since $PREV)" >> "$NOTES.new"
echo "-------------------------------------------------" >> "$NOTES.new"
echo -e "\nRelease date: `date`\n" >> "$NOTES.new"
git shortlog --no-merges $PREV..HEAD >> "$NOTES.new"
echo >> "$NOTES.new"
cat "$NOTES" >> "$NOTES.new"
mv "$NOTES.new" "$NOTES"
git add "$NOTES"
git commit -m "automatically updated release notes for $NEW"
################ tag and add tag message
echo > /tmp/tagmessage
echo "Release $NEW" >> /tmp/tagmessage
echo >> /tmp/tagmessage
echo "Changes in $NEW (since $PREV):" >> /tmp/tagmessage
echo >> /tmp/tagmessage
git shortlog --no-merges $PREV..HEAD >> /tmp/tagmessage
git tag -a "$NEW" -m "`cat /tmp/tagmessage`"
################ push everything
git push origin HEAD
git push --tags
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化