make-release.sh 541 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. VER=$1
  3. MSG=$2
  4. if [ -z "$MSG" ]; then
  5. MSG="Weekly Release"
  6. fi
  7. echo Creating a new release: $VER: $MSG
  8. IFS="." read -a PARTS <<< "$VER"
  9. MAJOR=${PARTS[0]}
  10. MINOR=${PARTS[1]}
  11. MINOR=$((MINOR+1))
  12. VERN=${MAJOR}.${MINOR}
  13. pushd $GOPATH/src/github.com/v2ray/v2ray-core
  14. echo "Adding a new tag: " "v$VER"
  15. git tag -s -a "v$VER" -m "$MSG"
  16. sed -i '' "s/\(version *= *\"\).*\(\"\)/\1$VERN\2/g" core.go
  17. echo "Commiting core.go (may not necessary)"
  18. git commit core.go -S -m "Update version"
  19. echo "Pushing changes"
  20. git push --follow-tags
  21. popd