diff options
author | Léo Andrès <leo@ndrs.fr> | 2018-03-27 09:35:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-27 10:35:12 +0200 |
commit | 0e4ffb4b678962d5ff7a4a7d8952033bc84725da (patch) | |
tree | b116dfe4244f645aa1c4740039544010ef7c3194 /scripts/release.sh | |
parent | d5b7d9110dd637a7f67ce9e430145314812a8df1 (diff) | |
download | PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.tar.gz PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.tar.zst PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.zip |
Clean shell scripts (#398)
Diffstat (limited to 'scripts/release.sh')
-rwxr-xr-x | scripts/release.sh | 40 |
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 | ||
3 | set -eu | ||
4 | |||
3 | shutdown() { | 5 | shutdown() { |
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 |
17 | fi | 19 | fi |
18 | 20 | ||
19 | if [ -z $GITHUB_TOKEN ]; then | 21 | if [ -z "$GITHUB_TOKEN" ]; then |
20 | echo "Need GITHUB_TOKEN env set." | 22 | echo "Need GITHUB_TOKEN env set." |
21 | exit -1 | 23 | exit -1 |
22 | fi | 24 | fi |
@@ -33,43 +35,41 @@ zip_name="peertube-$version.zip" | |||
33 | 35 | ||
34 | changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}') | 36 | changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}') |
35 | 37 | ||
36 | echo -e "Changelog will be:\n" | 38 | printf "Changelog will be:\n%s\n" "$changelog" |
37 | echo "$changelog" | ||
38 | echo | ||
39 | 39 | ||
40 | read -p "Are you sure to release? " -n 1 -r | 40 | read -p "Are you sure to release? " -n 1 -r |
41 | echo | 41 | echo |
42 | if [[ ! $REPLY =~ ^[Yy]$ ]] | 42 | if [[ ! $REPLY =~ ^[Yy]$ ]] |
43 | then | 43 | then |
44 | [[ "$0" = "$BASH_SOURCE" ]] && exit 0 | 44 | exit 0 |
45 | fi | 45 | fi |
46 | 46 | ||
47 | cd ./client || exit -1 | 47 | ( cd client |
48 | npm 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 | ||
50 | cd ../ || exit -1 | 51 | npm version -f --no-git-tag-version --no-commit-hooks "$1" |
51 | npm version -f --no-git-tag-version --no-commit-hooks $1 || exit -1 | ||
52 | 52 | ||
53 | git commit package.json client/package.json -m "Bumped to version $version" || exit -1 | 53 | git commit package.json client/package.json -m "Bumped to version $version" |
54 | git tag -s -a "$version" -m "$version" | 54 | git tag -s -a "$version" -m "$version" |
55 | 55 | ||
56 | npm run build || exit -1 | 56 | npm run build |
57 | rm "./client/dist/stats.json" || exit -1 | 57 | rm "./client/dist/stats.json" |
58 | 58 | ||
59 | cd ../ || exit -1 | 59 | cd .. |
60 | 60 | ||
61 | ln -s "PeerTube" "$directory_name" || exit -1 | 61 | ln -s "PeerTube" "$directory_name" |
62 | zip -r "PeerTube/$zip_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ | 62 | zip -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 | |
70 | rm "$directory_name" || exit -1 | 70 | rm "$directory_name" |
71 | 71 | ||
72 | cd "PeerTube" || exit -1 | 72 | cd "PeerTube" |
73 | 73 | ||
74 | git push origin --tag | 74 | git push origin --tag |
75 | 75 | ||