mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			666 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			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"
 |