67 lines
1.8 KiB
Bash
Executable file
67 lines
1.8 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e -u
|
|
|
|
RELEASE_VERSION=$1
|
|
CURRENT_VERSION="$RELEASE_VERSION-SNAPSHOT"
|
|
|
|
# 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?
|
|
|
|
# grep $RELEASE_VERSION NEWS.md || echo "Add $RELEASE_VERSION to NEWS.md" && exit 1
|
|
|
|
lein vcs assert-committed
|
|
|
|
for f in bin/lein bin/lein-pkg bin/lein.bat project.clj leiningen-core/project.clj; do
|
|
sed -i s/$CURRENT_VERSION/$RELEASE_VERSION/ $f
|
|
done
|
|
|
|
rm -rf target classes leiningen-core/target leiningen-core/classes leiningen-core/lib
|
|
rm -rf $HOME/.lein/self-installs/leiningen-$RELEASE_VERSION-standalone.jar
|
|
|
|
LEIN_ROOT=$PWD
|
|
|
|
cd leiningen-core
|
|
lein2 do clean, install
|
|
cd ..
|
|
|
|
bin/lein uberjar
|
|
RELEASE_JAR=$PWD/target/leiningen-$RELEASE_VERSION-standalone.jar
|
|
cp $RELEASE_JAR $HOME/.lein/self-installs
|
|
|
|
cp bin/lein /tmp/lein-$RELEASE_VERSION
|
|
cd /tmp
|
|
|
|
if [ ! -r test-project ]; then
|
|
./lein-$RELEASE_VERSION new test-project
|
|
fi
|
|
|
|
cd test-project
|
|
|
|
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
|
|
|
|
echo "Are these acceptable times? (~3s) [Y\n]"
|
|
read CONTINUE
|
|
case "$CONTINUE" in
|
|
y|Y|"")
|
|
gpg -ab $RELEASE_JAR;;
|
|
*)
|
|
echo "Aborted."
|
|
exit 1;;
|
|
esac
|
|
|
|
cd $LEIN_ROOT
|
|
|
|
git commit -a -m "Release $RELEASE_VERSION"
|
|
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."
|
|
|
|
rm -rf target leiningen-core/target
|
|
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."
|