-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathci
executable file
·54 lines (43 loc) · 943 Bytes
/
ci
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
#!/usr/bin/env bash
set -ex
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function die {
echo "$*" >&2
exit 1
}
case "$1" in
jitpack)
exec $0 mill -j 0 __.publishM2Local
;;
mill)
exec $0 cs launch "mill:$(< .mill-version)" -- "${@:2}"
;;
scalafmt)
exec $0 cs launch scalafmt -- --mode diff --diff-branch master "${@:2}"
;;
cs)
test -x $BASE_DIR/cs || {
curl -o $BASE_DIR/cs -qL https://git.io/coursier-cli
chmod +x $BASE_DIR/cs
}
exec $BASE_DIR/cs "${@:2}"
;;
example)
test -f example/secrets.env || die "Missing example/secrets.env"
(
cd example
../ci mill _.docker.build
docker run --rm --env-file secrets.env -ti keybase-scala-example
)
;;
test)
$0 mill -j 0 __.compile
(cd example; ../ci mill example.compile)
# $0 mill -j 0 __.tests
$0 scalafmt --test
;;
release)
git tag $(<VERSION)
git push --tags
;;
esac