forked from technomancy/leiningen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease
executable file
·63 lines (48 loc) · 1.72 KB
/
release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -e -u
RELEASE_VERSION=$1
CURRENT_VERSION="$RELEASE_VERSION-SNAPSHOT"
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
lein 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
# s3c is an s3cmd wrapper for people who don't hate security:
# https://github.com/technomancy/dotfiles/blob/master/bin/s3c
s3c lein put -P $RELEASE_JAR s3://leiningen/downloads/
s3c lein put -P $RELEASE_JAR.asc s3://leiningen/downloads/
echo "Uploaded";;
*)
echo "Aborted."
exit 1;;
esac
cd $LEIN_ROOT
git commit -a -m "Release $RELEASE_VERSION"
rm -rf target leiningen-core/target
echo "Test self-install."
echo "If things are good, run this:"
echo "$ git tag -s $RELEASE_VERSION -m \"Release $RELEASE_VERSION\""
echo "$ git push && git push --tags && git push origin master:stable"
echo "$ lein deploy clojars"
echo "$ cd leiningen-core && lein deploy clojars"