2012-06-02 04:44:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e -u
|
|
|
|
|
2013-08-09 00:37:08 +00:00
|
|
|
RELEASE_VERSION=$1
|
|
|
|
CURRENT_VERSION="$RELEASE_VERSION-SNAPSHOT"
|
2012-06-02 04:44:09 +00:00
|
|
|
|
2014-06-15 21:10:50 +00:00
|
|
|
# Would like to use `lein release` here, but we don't have a way to
|
|
|
|
# update the bash scripts or watch for boot slowdowns that way. Maybe
|
|
|
|
# try adding lein-shell?
|
|
|
|
|
2014-09-06 22:14:57 +00:00
|
|
|
if [ ! -x `which lein-stable` ]; then
|
|
|
|
echo "Install a stable version of Leiningen as lein-stable."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
grep $RELEASE_VERSION NEWS.md || (echo "Add $RELEASE_VERSION to NEWS.md" && exit 1)
|
2014-08-05 22:52:37 +00:00
|
|
|
|
2014-06-15 21:10:50 +00:00
|
|
|
lein vcs assert-committed
|
|
|
|
|
2013-01-17 05:04:47 +00:00
|
|
|
for f in bin/lein bin/lein-pkg bin/lein.bat project.clj leiningen-core/project.clj; do
|
2012-06-02 04:44:09 +00:00
|
|
|
sed -i s/$CURRENT_VERSION/$RELEASE_VERSION/ $f
|
|
|
|
done
|
|
|
|
|
2013-08-09 00:37:08 +00:00
|
|
|
rm -rf target classes leiningen-core/target leiningen-core/classes leiningen-core/lib
|
2012-06-02 04:44:09 +00:00
|
|
|
rm -rf $HOME/.lein/self-installs/leiningen-$RELEASE_VERSION-standalone.jar
|
|
|
|
|
2013-08-09 00:37:08 +00:00
|
|
|
LEIN_ROOT=$PWD
|
|
|
|
|
2012-06-02 04:44:09 +00:00
|
|
|
cd leiningen-core
|
2014-09-06 22:14:57 +00:00
|
|
|
lein-stable do clean, install
|
2012-06-02 04:44:09 +00:00
|
|
|
cd ..
|
|
|
|
|
2013-08-09 00:37:08 +00:00
|
|
|
bin/lein uberjar
|
2013-08-09 17:24:31 +00:00
|
|
|
RELEASE_JAR=$PWD/target/leiningen-$RELEASE_VERSION-standalone.jar
|
|
|
|
cp $RELEASE_JAR $HOME/.lein/self-installs
|
2012-06-02 04:44:09 +00:00
|
|
|
|
|
|
|
cp bin/lein /tmp/lein-$RELEASE_VERSION
|
|
|
|
cd /tmp
|
|
|
|
|
2012-06-14 04:43:22 +00:00
|
|
|
if [ ! -r test-project ]; then
|
|
|
|
./lein-$RELEASE_VERSION new test-project
|
|
|
|
fi
|
2012-06-02 04:44:09 +00:00
|
|
|
|
2012-06-14 04:43:22 +00:00
|
|
|
cd test-project
|
|
|
|
|
2014-09-06 22:14:57 +00:00
|
|
|
echo "Running a few invocations in order to check boot time..."
|
|
|
|
|
2012-06-14 04:43:22 +00:00
|
|
|
time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
|
|
|
|
time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
|
|
|
|
time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
|
|
|
|
|
2014-09-06 22:14:57 +00:00
|
|
|
echo "Check that these are about the same boot times as with the last version."
|
|
|
|
echo "Run this in a project: time lein-stable run -m clojure.main/main -e nil"
|
2013-08-09 17:24:31 +00:00
|
|
|
echo "Are these acceptable times? (~3s) [Y\n]"
|
|
|
|
read CONTINUE
|
|
|
|
case "$CONTINUE" in
|
|
|
|
y|Y|"")
|
2014-06-09 23:17:48 +00:00
|
|
|
gpg -ab $RELEASE_JAR;;
|
2013-08-09 17:24:31 +00:00
|
|
|
*)
|
|
|
|
echo "Aborted."
|
|
|
|
exit 1;;
|
|
|
|
esac
|
2012-06-02 04:44:09 +00:00
|
|
|
|
2013-08-09 00:37:08 +00:00
|
|
|
cd $LEIN_ROOT
|
2013-04-12 17:02:18 +00:00
|
|
|
|
|
|
|
git commit -a -m "Release $RELEASE_VERSION"
|
2014-06-09 23:17:48 +00:00
|
|
|
git tag -s $RELEASE_VERSION -m "Release $RELEASE_VERSION"
|
|
|
|
git push && git push --tags && git push origin master:stable
|
|
|
|
|
|
|
|
echo "Upload $RELEASE_JAR and $RELEASE_JAR.asc to GitHub releases for $RELEASE_VERSION."
|
2014-09-06 22:14:57 +00:00
|
|
|
echo "Copy this version's section of NEWS.md to the GitHub release description."
|
2013-04-12 17:02:18 +00:00
|
|
|
|
2013-11-19 18:05:36 +00:00
|
|
|
rm -rf target leiningen-core/target
|
2014-06-09 23:17:48 +00:00
|
|
|
echo "Test self-install. If things are good, run this:"
|
|
|
|
echo "$ lein deploy clojars && cd leiningen-core && lein deploy clojars"
|
|
|
|
echo "And announce it on the mailing list."
|