Skip to content

Commit

Permalink
better release mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ring committed Jun 16, 2016
1 parent a16a286 commit 1c7cd2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
1.1-SNAPSHOT
1.1-SNAPSHOT
1.0.3
8 changes: 5 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash
if [ $# = 2 ]; then
old=$(cat .version)
old=$(sed "1q;d" .version)
before=$(sed "2q;d" .version)
new="$1"
next="$2-SNAPSHOT"
echo "version was: $old"
echo "releasing version $new"
sed -i "s/\"$old\"/\"$new\"/g" build.sbt
sed -i "s/\"$old\"/\"$new\"/g" modules/cobra-server/src/main/scala/net/flatmap/cobra/Cobra.scala
sed -i "s/$old/$new/g" README.md
sed -i "s/$before/$new/g" README.md
sed -i "s/$old/$new/g" .bintray-deb.yml .bintray-rpm.yml
git add build.sbt modules/cobra-server/src/main/scala/net/flatmap/cobra/Cobra.scala README.md
git add build.sbt modules/cobra-server/src/main/scala/net/flatmap/cobra/Cobra.scala README.md .bintray-deb.yml .bintray-rpm.yml
git commit -m "release version $new"
git tag -a "version-$new" -m "Version $new"
git push origin "version-$new"
Expand All @@ -18,6 +19,7 @@ if [ $# = 2 ]; then
sed -i "s/version\\s+:=\\s+\"$old\"/version := \"$new\"/g" build.sbt
sed -i "s/val\\s+version\\s+=\\s\"$old\"/val version = \"$new\"/g" modules/cobra-server/src/main/scala/net/flatmap/cobra/Cobra.scala
sed -i "s/$old/$next/g" .version
sed -i "s/$before/$new/g" .version
else
echo "usage: ./release.sh <version> <next-version>"
fi

0 comments on commit 1c7cd2d

Please sign in to comment.