From 54ac81fb982fa92ef9d979d1e9973cfe6c1edc3e Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 1 Feb 2024 10:03:42 +0100 Subject: [PATCH] Add publish_new_release.sh script --- publish_new_release.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 publish_new_release.sh diff --git a/publish_new_release.sh b/publish_new_release.sh new file mode 100755 index 0000000..678a529 --- /dev/null +++ b/publish_new_release.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +ROOT_DIR=$( dirname $( realpath $0 ) ) + +set -e + +echo -n "Getting latest release..." +LATEST=$( curl --silent https://forgejo.org/releases/rss.xml|xq '.rss.channel.item[0].title'|tr -d '"'|sed 's/^v//' ) +echo done. + +echo "Latest release: $LATEST" +[ -n "$( git tag -l "$LATEST" )" ] && echo "Release $LATEST already exists" && exit 1 + +echo "Press [enter] to create and publish this new release" +read + +echo "Create new release..." +cd $ROOT_DIR +echo -n "$LATEST" > last_release.txt +git add last_release.txt +git commit -m "Release $LATEST" +git tag "$LATEST" +echo done. + +echo "Publish new release..." +git push +git push --tags +echo done.