github.com/danbrough/mobile@v0.0.3-beta03/publish.sh (about)

     1  #!/bin/bash
     2  
     3  cd `dirname $0`
     4  
     5  if [ -f .version ]; then 
     6  	VERSION=$(cat .version)
     7  else 
     8  	VERSION=0
     9  fi
    10  
    11  VERSION=$(($VERSION + 1))
    12  
    13  VERSION_NAME=`printf "v0.0.3-beta%02d" $VERSION`
    14  
    15  echo Creating release: '<'$VERSION_NAME'>'
    16  
    17  #while true; do
    18  #    read -p "Do you wish to proceed?: " yn
    19  #    case $yn in
    20  #        [Yy]* ) break;;
    21  #        [Nn]* ) exit;;
    22  #        * ) echo "Please answer yes or no.";;
    23  #    esac
    24  #done
    25  
    26  if git tag | grep "$VERSION_NAME" > /dev/null; then
    27    while true; do
    28      read -p "Existing Tag $VERSION_NAME found. Shall I delete it?: " yn
    29      case $yn in
    30          [Yy]* ) break;;
    31          [Nn]* ) exit;;
    32          * ) echo "Please answer yes or no.";;
    33      esac
    34    done
    35    echo removing existing tag "$VERSION_NAME"
    36    git tag -d "$VERSION_NAME"
    37    git push origin --delete "$VERSION_NAME"
    38  fi
    39  
    40  printf $VERSION > .version
    41  git add .
    42  git commit -am "$VERSION_NAME"
    43  git tag "$VERSION_NAME" && git push && git push origin "$VERSION_NAME"
    44  
    45  echo running GOPROXY=proxy.golang.org go list -m  github.com/danbrough/mobile@$VERSION_NAME
    46  GOPROXY=proxy.golang.org go list -m  github.com/danbrough/mobile@$VERSION_NAME
    47  
    48  
    49  
    50