Skip to content

Commit 892a113

Browse files
committed
Update release script and description
1 parent 2384dbe commit 892a113

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

release

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ set -o xtrace
44

55
dist=`stack path --dist-dir --stack-yaml ./stack.yaml 2> /dev/null`
66

7+
rootdir=`pwd`
8+
9+
cabalfile=`ls *.cabal`
10+
packagename="${cabalfile%%.*}"
11+
version=`grep '^version:' schematic.cabal | rev | cut -d" " -f1 | rev`
12+
713
echo -e "\033[1;36mTesting library...\033[0m"
814
stack test 2> /dev/null
915

@@ -18,17 +24,18 @@ if [ "$?" -eq "0" ]; then
1824
read -p "Hackage username: " username
1925
read -p "Hackage password: " -s password
2026
echo ""
21-
cabal upload -u $username -p $password dist/$1-$2.tar.gz
27+
cabal upload -u $username -p $password dist/$packagename-$version.tar.gz
2228

23-
docdir=$dist/doc/html
24-
cd $docdir
25-
doc=$1-$2-docs
29+
docdir=`find .stack-work -name "$packagename-$version-docs"`
2630

27-
echo -e "Compressing documentation from \033[1;34m$docdir\033[0m for \033[1;35m$1\033[0m-\033[1;33m$2\033[1;30m"
28-
cp -r $1 $doc
29-
tar -c -v -z --format=ustar -f $doc.tar.gz $doc
31+
echo -e "Compressing documentation from \033[1;34m$docdir\033[0m for \033[1;35m$packagename\033[0m-\033[1;33m$version\033[1;30m"
32+
tar -c -v -z --format=ustar -f $docdir.tar.gz $docdir
3033
echo -e "\033[1;32mUploading documentation to Hackage...\033[0m"
31-
curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@$doc.tar.gz" "https://$username:$password@hackage.haskell.org/package/$1-$2/docs"
34+
cd $docdir
35+
cd ..
36+
curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "$packagename-$version-docs.tar.gz" "https://$username:$password@hackage.haskell.org/package/$packagename-$version/candidate/docs"
37+
open "https://hackage.haskell.org/package/$packagename-$version/candidate/"
38+
cd $rootdir
3239
exit $?
3340
else
3441
echo -e "\033[1;31mNot in a stack-powered project\033[0m"

schematic.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: schematic
22
version: 0.5.0.0
33
synopsis: JSON-biased spec and validation tool
4+
description: JSON-biased spec and validation tool. Makes possible to have a schema as a haskell type and derive json instances, validation actions, JSON generation for property-test generically. Built-in lens support.
45
license: BSD3
56
license-file: LICENSE
67
author: Denis Redozubov

0 commit comments

Comments
 (0)