aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/release.sh
diff options
context:
space:
mode:
authorLéo Andrès <leo@ndrs.fr>2018-03-27 09:35:12 +0100
committerChocobozzz <me@florianbigard.com>2018-03-27 10:35:12 +0200
commit0e4ffb4b678962d5ff7a4a7d8952033bc84725da (patch)
treeb116dfe4244f645aa1c4740039544010ef7c3194 /scripts/release.sh
parentd5b7d9110dd637a7f67ce9e430145314812a8df1 (diff)
downloadPeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.tar.gz
PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.tar.zst
PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.zip
Clean shell scripts (#398)
Diffstat (limited to 'scripts/release.sh')
-rwxr-xr-xscripts/release.sh40
1 files changed, 20 insertions, 20 deletions
diff --git a/scripts/release.sh b/scripts/release.sh
index 8c440975f..6f4da6a29 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -1,11 +1,13 @@
1#!/bin/bash 1#!/bin/bash
2 2
3set -eu
4
3shutdown() { 5shutdown() {
4 # Get our process group id 6 # Get our process group id
5 PGID=$(ps -o pgid= $$ | grep -o [0-9]*) 7 PGID=$(ps -o pgid= $$ | grep -o "[0-9]*")
6 8
7 # Kill it in a new new process group 9 # Kill it in a new new process group
8 setsid kill -- -$PGID 10 setsid kill -- -"$PGID"
9 exit 0 11 exit 0
10} 12}
11 13
@@ -16,7 +18,7 @@ if [ -z "$1" ]; then
16 exit -1 18 exit -1
17fi 19fi
18 20
19if [ -z $GITHUB_TOKEN ]; then 21if [ -z "$GITHUB_TOKEN" ]; then
20 echo "Need GITHUB_TOKEN env set." 22 echo "Need GITHUB_TOKEN env set."
21 exit -1 23 exit -1
22fi 24fi
@@ -33,43 +35,41 @@ zip_name="peertube-$version.zip"
33 35
34changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}') 36changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}')
35 37
36echo -e "Changelog will be:\n" 38printf "Changelog will be:\n%s\n" "$changelog"
37echo "$changelog"
38echo
39 39
40read -p "Are you sure to release? " -n 1 -r 40read -p "Are you sure to release? " -n 1 -r
41echo 41echo
42if [[ ! $REPLY =~ ^[Yy]$ ]] 42if [[ ! $REPLY =~ ^[Yy]$ ]]
43then 43then
44 [[ "$0" = "$BASH_SOURCE" ]] && exit 0 44 exit 0
45fi 45fi
46 46
47cd ./client || exit -1 47( cd client
48npm version --no-git-tag-version --no-commit-hooks $1 || exit -1 48 npm version --no-git-tag-version --no-commit-hooks "$1"
49)
49 50
50cd ../ || exit -1 51npm version -f --no-git-tag-version --no-commit-hooks "$1"
51npm version -f --no-git-tag-version --no-commit-hooks $1 || exit -1
52 52
53git commit package.json client/package.json -m "Bumped to version $version" || exit -1 53git commit package.json client/package.json -m "Bumped to version $version"
54git tag -s -a "$version" -m "$version" 54git tag -s -a "$version" -m "$version"
55 55
56npm run build || exit -1 56npm run build
57rm "./client/dist/stats.json" || exit -1 57rm "./client/dist/stats.json"
58 58
59cd ../ || exit -1 59cd ..
60 60
61ln -s "PeerTube" "$directory_name" || exit -1 61ln -s "PeerTube" "$directory_name"
62zip -r "PeerTube/$zip_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ 62zip -r "PeerTube/$zip_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \
63 "$directory_name/LICENSE" "$directory_name/README.md" \ 63 "$directory_name/LICENSE" "$directory_name/README.md" \
64 "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ 64 "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \
65 "$directory_name/client/package.json" "$directory_name/config" \ 65 "$directory_name/client/package.json" "$directory_name/config" \
66 "$directory_name/dist" "$directory_name/package.json" \ 66 "$directory_name/dist" "$directory_name/package.json" \
67 "$directory_name/scripts" "$directory_name/support" \ 67 "$directory_name/scripts" "$directory_name/support" \
68 "$directory_name/tsconfig.json" "$directory_name/yarn.lock" \ 68 "$directory_name/tsconfig.json" "$directory_name/yarn.lock"
69 || exit -1 69
70rm "$directory_name" || exit -1 70rm "$directory_name"
71 71
72cd "PeerTube" || exit -1 72cd "PeerTube"
73 73
74git push origin --tag 74git push origin --tag
75 75