]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/release.sh
Search video channel handle/uri
[github/Chocobozzz/PeerTube.git] / scripts / release.sh
index b5fa68f424b43a16a3dfbbed0d18f5680a33f4e4..ef6399b68a2ff6690892d6842d9909be49d84f06 100755 (executable)
@@ -25,8 +25,8 @@ if [ -z "$GITHUB_TOKEN" ]; then
 fi
 
 branch=$(git symbolic-ref --short -q HEAD)
-if [ "$branch" != "develop" ]; then
-  echo "Need to be on develop branch."
+if [ "$branch" != "develop" ] && [[ "$branch" != feature/* ]]; then
+  echo "Need to be on develop or release branch."
   exit -1
 fi
 
@@ -47,8 +47,7 @@ printf "Changelog will be:\\n%s\\n" "$changelog"
 
 read -p "Are you sure to release? " -n 1 -r
 echo
-if [[ ! $REPLY =~ ^[Yy]$ ]]
-then
+if [[ ! $REPLY =~ ^[Yy]$ ]]; then
   exit 0
 fi
 
@@ -96,20 +95,25 @@ rm "./client/dist/embed-stats.json"
 (
   git push origin --tag
 
-  github-release release --user chocobozzz --repo peertube --tag "$version" --name "$version" --description "$changelog" "$github_prerelease_option"
+  if [ -z "$github_prerelease_option" ]; then
+    github-release release --user chocobozzz --repo peertube --tag "$version" --name "$version" --description "$changelog"
+  else
+    github-release release --user chocobozzz --repo peertube --tag "$version" --name "$version" --description "$changelog" "$github_prerelease_option"
+  fi
+
   github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$zip_name" --file "$zip_name"
   github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$zip_name.asc" --file "$zip_name.asc"
   github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$tar_name" --file "$tar_name"
   github-release upload --user chocobozzz --repo peertube --tag "$version" --name "$tar_name.asc" --file "$tar_name.asc"
 
-  git push origin develop
+  git push origin "$branch"
 
   # Only update master if it is not a pre release
   if [ -z "$github_prerelease_option" ]; then
       # Update master branch
       git checkout master
-      git rebase develop
+      git merge "$branch"
       git push origin master
-      git checkout develop
+      git checkout "$branch"
   fi
 )