leiningen/bin/release
2012-06-27 16:45:13 -07:00

48 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
set -e -u
CURRENT_VERSION=$1
RELEASE_VERSION=$2
for f in bin/lein 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
rm -rf $HOME/.lein/self-installs/leiningen-$RELEASE_VERSION-standalone.jar
cd leiningen-core
sed -i s/\;\;:aot/:aot/ project.clj
lein1 clean, install
sed -i s/:aot/\;\;:aot/ project.clj
cd ..
bin/lein with-profile release uberjar
cp target/leiningen-$RELEASE_VERSION-standalone.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 "If these are under 3 seconds then you should be set to upload"
echo "target/leiningen-$RELEASE_VERSION-standalone.jar to GitHub."
echo "Also deploy this release of leiningen-core to Clojars."
# Still manual for now:
# cd leiningen-core; lein do clean, deploy clojars, marg
# scp docs/uberdoc.html leiningen.org:leiningen.org/reference.html
# git commit -a -m "Release $RELEASE_VERSION"
# git tag $RELEASE_VERSION
# git push && git push --tags
# git checkout preview && git reset --hard $RELEASE_VERSION && git push
# Drop version back to SNAPSHOT