2024-02-01 10:03:42 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
ROOT_DIR=$( dirname $( realpath $0 ) )
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2024-03-10 19:00:41 +01:00
|
|
|
LATEST="$1"
|
|
|
|
|
|
|
|
if [ -z "$LATEST" ]
|
|
|
|
then
|
|
|
|
echo -n "Getting latest release..."
|
|
|
|
LATEST=$( curl --silent https://forgejo.org/releases/rss.xml|xq -x '/rss/channel/item[1]/title'|sed 's/^v//' )
|
|
|
|
echo done.
|
|
|
|
fi
|
2024-02-01 10:03:42 +01:00
|
|
|
|
|
|
|
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.
|