代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。