07fec00b83b6ededcdccde9862dd70eb471c2a70
[oweals/peertube.git] / scripts / release.sh
1 #!/bin/bash
2
3 shutdown() {
4   # Get our process group id
5   PGID=$(ps -o pgid= $$ | grep -o [0-9]*)
6
7   # Kill it in a new new process group
8   setsid kill -- -$PGID
9   exit 0
10 }
11
12 trap "shutdown" SIGINT SIGTERM
13
14 if [ -z "$1" ]; then
15   echo "Need version as argument"
16   exit -1
17 fi
18
19 cd ./client || exit -1
20 npm version --no-git-tag-version --no-commit-hooks $1 || exit -1
21
22 cd ../ || exit -1
23 npm version -f --no-git-tag-version --no-commit-hooks $1 || exit -1
24
25 git commit package.json client/package.json -m "Bumped to version $1" || exit -1
26 git tag -s -a "v$1" -m "v$1"
27
28 npm run build || exit -1
29 #npm test || exit -1
30
31 cd ../ || exit -1
32 rm -f PeerTube/peertube.zip || exit -1
33 zip -r PeerTube/peertube.zip PeerTube/{CREDITS.md,node_modules,FAQ.md,LICENSE,README.md,client/dist/,client/yarn.lock,client/package.json,config,dist,package.json,scripts,support,tsconfig.json,yarn.lock}