1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00
srs/trunk/3rdparty/signaling/auto/pub.sh
2022-05-16 22:24:27 +08:00

27 lines
666 B
Bash
Executable file

#!/bin/bash
REALPATH=$(realpath $0)
WORK_DIR=$(cd $(dirname $REALPATH)/.. && pwd)
echo "Run pub at $WORK_DIR from $0"
cd $WORK_DIR
git st |grep -q 'nothing to commit'
if [[ $? -ne 0 ]]; then
echo "Failed: Please commit before release";
exit 1
fi
RELEASE=$(git describe --tags --abbrev=0 --exclude release-*)
REVISION=$(echo $RELEASE|awk -F . '{print $3}')
let NEXT=$REVISION+1
echo "Last release is $RELEASE, revision is $REVISION, next is $NEXT"
TAG="v1.0.$NEXT"
echo "publish $TAG"
git push
git tag -d $TAG 2>/dev/null && git push origin :$TAG
git tag $TAG
git push origin $TAG
echo "publish $TAG ok"
echo " https://github.com/ossrs/signaling/actions"