diff options
-rwxr-xr-x | scripts/release.sh | 69 |
1 files changed, 44 insertions, 25 deletions
diff --git a/scripts/release.sh b/scripts/release.sh index 6f4da6a29..dbc348cb2 100755 --- a/scripts/release.sh +++ b/scripts/release.sh | |||
@@ -4,6 +4,7 @@ set -eu | |||
4 | 4 | ||
5 | shutdown() { | 5 | shutdown() { |
6 | # Get our process group id | 6 | # Get our process group id |
7 | # shellcheck disable=SC2009 | ||
7 | PGID=$(ps -o pgid= $$ | grep -o "[0-9]*") | 8 | PGID=$(ps -o pgid= $$ | grep -o "[0-9]*") |
8 | 9 | ||
9 | # Kill it in a new new process group | 10 | # Kill it in a new new process group |
@@ -32,10 +33,11 @@ fi | |||
32 | version="v$1" | 33 | version="v$1" |
33 | directory_name="peertube-$version" | 34 | directory_name="peertube-$version" |
34 | zip_name="peertube-$version.zip" | 35 | zip_name="peertube-$version.zip" |
36 | tar_name="peertube-$version.tar.xz" | ||
35 | 37 | ||
36 | changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}') | 38 | changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}') |
37 | 39 | ||
38 | printf "Changelog will be:\n%s\n" "$changelog" | 40 | printf "Changelog will be:\\n%s\\n" "$changelog" |
39 | 41 | ||
40 | read -p "Are you sure to release? " -n 1 -r | 42 | read -p "Are you sure to release? " -n 1 -r |
41 | echo | 43 | echo |
@@ -44,7 +46,8 @@ then | |||
44 | exit 0 | 46 | exit 0 |
45 | fi | 47 | fi |
46 | 48 | ||
47 | ( cd client | 49 | ( |
50 | cd client | ||
48 | npm version --no-git-tag-version --no-commit-hooks "$1" | 51 | npm version --no-git-tag-version --no-commit-hooks "$1" |
49 | ) | 52 | ) |
50 | 53 | ||
@@ -56,31 +59,47 @@ git tag -s -a "$version" -m "$version" | |||
56 | npm run build | 59 | npm run build |
57 | rm "./client/dist/stats.json" | 60 | rm "./client/dist/stats.json" |
58 | 61 | ||
59 | cd .. | 62 | # Creating the archives |
60 | 63 | ( | |
61 | ln -s "PeerTube" "$directory_name" | 64 | cd .. |
62 | zip -r "PeerTube/$zip_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ | 65 | ln -s "PeerTube" "$directory_name" |
63 | "$directory_name/LICENSE" "$directory_name/README.md" \ | 66 | zip -r "PeerTube/$zip_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ |
64 | "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ | 67 | "$directory_name/LICENSE" "$directory_name/README.md" \ |
65 | "$directory_name/client/package.json" "$directory_name/config" \ | 68 | "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ |
66 | "$directory_name/dist" "$directory_name/package.json" \ | 69 | "$directory_name/client/package.json" "$directory_name/config" \ |
67 | "$directory_name/scripts" "$directory_name/support" \ | 70 | "$directory_name/dist" "$directory_name/package.json" \ |
68 | "$directory_name/tsconfig.json" "$directory_name/yarn.lock" | 71 | "$directory_name/scripts" "$directory_name/support" \ |
69 | 72 | "$directory_name/tsconfig.json" "$directory_name/yarn.lock" | |
70 | rm "$directory_name" | 73 | gpg --armor --detach-sign -u 583A612D890159BE "PeerTube/$zip_name" |
71 | 74 | tar cfJ "PeerTube/$tar_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ | |
72 | cd "PeerTube" | 75 | "$directory_name/LICENSE" "$directory_name/README.md" \ |
76 | "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ | ||
77 | "$directory_name/client/package.json" "$directory_name/config" \ | ||
78 | "$directory_name/dist" "$directory_name/package.json" \ | ||
79 | "$directory_name/scripts" "$directory_name/support" \ | ||
80 | "$directory_name/tsconfig.json" "$directory_name/yarn.lock" | ||
81 | gpg --armor --detach-sign -u 583A612D890159BE "PeerTube/$tar_name" | ||
82 | |||
83 | rm "$directory_name" | ||
84 | ) | ||
73 | 85 | ||
74 | git push origin --tag | 86 | # Creating the release on GitHub, with the created archives |
87 | ( | ||
88 | cd "PeerTube" | ||
75 | 89 | ||
76 | github-release release --user chocobozzz --repo peertube --tag "$version" --name "$version" --description "$changelog" | 90 | git push origin --tag |
77 | github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$zip_name" --file "$zip_name" | ||
78 | 91 | ||
79 | git push origin develop | 92 | github-release release --user chocobozzz --repo peertube --tag "$version" --name "$version" --description "$changelog" |
93 | github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$zip_name" --file "$zip_name" | ||
94 | github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$zip_name.asc" --file "$zip_name.asc" | ||
95 | github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$tar_name" --file "$tar_name" | ||
96 | github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$tar_name.asc" --file "$tar_name.asc" | ||
80 | 97 | ||
81 | # Update master branch | 98 | git push origin develop |
82 | git checkout master | ||
83 | git rebase develop | ||
84 | git push origin master | ||
85 | git checkout develop | ||
86 | 99 | ||
100 | # Update master branch | ||
101 | git checkout master | ||
102 | git rebase develop | ||
103 | git push origin master | ||
104 | git checkout develop | ||
105 | ) | ||