Add publish_new_release.sh script
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
f53167cb7b
commit
54ac81fb98
1 changed files with 28 additions and 0 deletions
28
publish_new_release.sh
Executable file
28
publish_new_release.sh
Executable file
|
@ -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.
|
Loading…
Reference in a new issue