From 002945d14fc4ca9282ea239147ebd1cdd8214ab4 Mon Sep 17 00:00:00 2001 From: Florian Steffens Date: Thu, 14 Sep 2023 21:50:53 +0200 Subject: [PATCH] add initial release script Signed-off-by: Florian Steffens --- release.sh | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 release.sh diff --git a/release.sh b/release.sh new file mode 100755 index 000000000..6415208e8 --- /dev/null +++ b/release.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +echo +echo "🚀 Lets make a new release!" +echo "===========================" + +echo +echo "Preparation steps:" +echo " - krankerl is installed" +echo " - Sign keys are under '~/.nextcloud'" +echo +echo " - All code changes are committed and merged" +echo " - CI is green" +echo +echo " - Version number bumped" +echo " - File 'releaseNotes.md' is up to date" +echo " - Update screenshots if needed" +echo +read -r -p "Are all the prepare steps done? [y/N] " CONFIRMATION + +if [[ "$CONFIRMATION" == "n" || "$CONFIRMATION" == "N" || -z "$CONFIRMATION" ]]; then + echo + echo "Aboard, please prepare carefully." + exit 1 +fi + +echo +read -r -p "Give me the release name (eg 'v0.6.0' or 'v0.6.0-beta.1'): " NAME + +if [[ -z "$NAME" ]]; then + echo + echo "🙄 Aboard, you have to give me a name." + exit 1 +fi + +echo +echo "# Build package" +echo "krankerl package" +echo "=========================" +krankerl package + +echo +echo "# create tag for this release" +echo "git tag -a $NAME -m '$NAME'" +echo "=========================" +git tag -a "$NAME" -m "$NAME" + +echo +echo "# push tag to repo origin" +echo "git push -u origin $NAME" +echo "=========================" +git push -u origin "$NAME" + +echo +echo "# push tag to repo releases" +echo "git push -u releases $NAME" +echo "=========================" +git push -u releases "$NAME" + +echo +echo "# publish at github repo origin" +echo "gh release --repo nextcloud/tables create '$NAME' ./build/artifacts/tables.tar.gz --notes-file releaseNotes.md -t 'Nextcloud tables $NAME'" +echo "=========================" +gh release --repo nextcloud/tables create "$NAME" ./build/artifacts/tables.tar.gz --notes-file releaseNotes.md -t "Nextcloud tables $NAME" + +echo +echo "# publish at github repo releases" +echo "gh release --repo nextcloud-releases/tables create '$NAME' ./build/artifacts/tables.tar.gz --notes-file releaseNotes.md -t 'Nextcloud tables $NAME'" +echo "=========================" +gh release --repo nextcloud-releases/tables create "$NAME" ./build/artifacts/tables.tar.gz --notes-file releaseNotes.md -t "Nextcloud tables $NAME" + + +echo +echo "# publish at appstore" +echo "krankerl publish https://github.com/nextcloud-releases/tables/releases/download/$NAME/tables.tar.gz" +echo "=========================" +bash -c "krankerl publish https://github.com/nextcloud-releases/tables/releases/download/$NAME/tables.tar.gz" + +echo +echo "Maybe you should create a stable-branch..." + +echo +echo "🍻 Cheers" +echo +exit 1