-
Notifications
You must be signed in to change notification settings - Fork 4
/
publish.sh
executable file
·35 lines (28 loc) · 928 Bytes
/
publish.sh
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
#!/bin/sh
set -e
dir=$(mktemp -d docs/dist-docs.XXXXXX)
# trap 'rm -r "$dir"' EXIT
VERSION=$(grep '^version:' churros.cabal | sed 's/[^ ]* *//')
echo "Library VERSION: $VERSION"
echo "Checklist:"
echo " [ ] - Update version"
echo " [ ] - Update changelog"
echo " [ ] - Run build"
echo " [ ] - Run tests - cabal exec -- cabal run churros-test"
echo " [ ] - Test docs locally"
echo ""
echo "proceed? "
read -r
cabal sdist
cabal haddock --builddir="$dir" --haddock-for-hackage
find "$dir" | grep index.html | head -n 1 | xargs open
if [ "$1" = "--publish" ]
then
cabal upload --publish dist-newstyle/sdist/churros-${VERSION}.tar.gz
cabal upload -d --publish $dir/*-docs.tar.gz
else
echo "Candidate mode. Use --publish argument to publish."
cabal upload dist-newstyle/sdist/churros-${VERSION}.tar.gz
cabal upload -d $dir/*-docs.tar.gz
echo "Candidate mode. Use --publish argument to publish."
fi