Guest User

Untitled

a guest
Feb 16th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Usage:
  4. # RELEASE_DIR=<directory to place fresh clones of projects> ./release.sh
  5.  
  6. set -e
  7.  
  8. # TODO: clone all the projects
  9. # cd $RELEASE_DIR
  10. # git@github.com:lampepfl/dotty
  11. # git clone git@github.com:lampepfl/dotty-example-project.git
  12. # git clone --single-branch --branch mill git@github.com:lampepfl/dotty-example-project.git
  13. # git clone git@github.com:lampepfl/dotty.g8.git
  14. # git clone git@github.com:lampepfl/dotty-cross.g8.git
  15. # git clone git@github.com:lampepfl/homebrew-brew.git
  16. # git clone git@github.com:lampepfl/packtest.git
  17. # git clone git@github.com:scalacenter/scastie/.git
  18.  
  19. # Parsing latest release from the list of tags not ending in RCX
  20. version=($(git tag --list '*.0' --sort=v:refname | tail -n1 | tr '.' '\n'))
  21.  
  22. major=${version[0]}
  23. minor=${version[1]}
  24. build=${version[2]}
  25.  
  26. LAST_RELEASE="$major.$minor"
  27.  
  28. RELEASE="$major.$((minor+1))"
  29.  
  30. RC_RELEASE="0.$((minor+2))"
  31.  
  32. V_NEXT="0.$((minor+3))"
  33.  
  34. echo "cd $RELEASE_DIR/dotty"
  35.  
  36. echo "git checkout $RELEASE.x"
  37.  
  38. echo "sed -i '' 's/^\([[:blank:]]*\)val baseVersion = \"$RELEASE.0-RC1\".*/\1val baseVersion = \"$RELEASE.0\"/' project/Build.scala"
  39.  
  40. echo "git commit -am 'Release Dotty $RELEASE.0'"
  41.  
  42. echo "git tag $RELEASE.0"
  43.  
  44. echo "git push --follow-tags --set-upstream origin $RELEASE"
  45.  
  46. echo "git checkout master"
  47.  
  48. echo "git merge $RELEASE.x"
  49.  
  50. echo "git push"
  51.  
  52. echo "git checkout -b $RC_RELEASE.x"
  53.  
  54. echo "sed -i '' 's/^\([[:blank:]]*\)val baseVersion = \"$RELEASE.0\".*/\1val baseVersion = \"$RC_RELEASE.0-RC1\"/' project/Build.scala"
  55.  
  56. echo "git commit -am 'Release Dotty $RC_RELEASE.0-RC1'"
  57.  
  58. echo "git tag $RC_RELEASE.0-RC1"
  59.  
  60. echo "git push --follow-tags --set-upstream origin $RC_RELEASE.x"
  61.  
  62. echo "git checkout master"
  63.  
  64. echo "sed -i '' 's/^\([[:blank:]]*\)val baseVersion = \"$RC_RELEASE.0\".*/\1val baseVersion = \"$V_NEXT.0\"/' project/Build.scala"
  65.  
  66. echo "git commit -am 'Set baseVersion to $V_NEXT.0'"
  67.  
  68. echo "git push"
  69.  
  70. # TODO: perform all the version bumps, commit, push and create the PRs
Add Comment
Please, Sign In to add comment