-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmake_release.sh
More file actions
executable file
·57 lines (43 loc) · 1.47 KB
/
make_release.sh
File metadata and controls
executable file
·57 lines (43 loc) · 1.47 KB
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
#!/bin/bash -e
VERSION=1.0.0
GITTAG="release-$VERSION"
echo "Using version $VERSION and tag $GITTAG"
echo "Have you updated the version number and the changelog? Type 'yes' if you have!"
read version_response
if [ "$version_response" != "yes" ]; then
echo "Go and update the version number"
exit 1
fi
git status
echo "Did git status contain pending changes? Nb. this script will commit make_release.sh (with the new version number)."
read version_response
if [ "$version_response" != "no" ]; then
echo "Commit them"
exit 1
fi
sed -i".old" -e "s/Version:.*/Version: $VERSION/g" libcspm.cabal
sed -i".old" -e "s/tag:.*/tag: $GITTAG/g" libcspm.cabal
rm libcspm.cabal.old
sed -i".old" -e "s/Version:.*/Version: $VERSION/g" cspmchecker/cspmchecker.cabal
sed -i".old" -e "s/tag:.*/tag: $GITTAG/g" cspmchecker/cspmchecker.cabal
sed -i".old" -e "s/libcspm >= .*,/libcspm >= $VERSION,/g" cspmchecker/cspmchecker.cabal
rm cspmchecker/cspmchecker.cabal.old
rm -rf dist
cabal sdist
cabal upload --check dist/libcspm-$VERSION.tar.gz
pushd cspmchecker >/dev/null
rm -rf dist
cabal sdist
cabal upload --check dist/cspmchecker-$VERSION.tar.gz
popd >/dev/null
#git stage make_release.sh
#git stage cspmchecker/cspmchecker.cabal
#git stage libcspm.cabal
#git commit -m "Updating version number for release"
#git tag $GITTAG
cabal upload dist/libcspm-$VERSION.tar.gz
pushd cspmchecker
cabal upload dist/cspmchecker-$VERSION.tar.gz
popd
#git push
#git push origin $GITTAG