misc: using stork for releases

This commit is contained in:
Simone Margaritelli 2021-04-18 15:43:15 +02:00
parent d6c7a73f39
commit 4441ae852c
3 changed files with 7 additions and 85 deletions

7
release.stork Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env stork -f
version:parser "__version__\\s*=\\s*['\"]([\\d\\.ab]+)[\"']"
version:file "pwnagotchi/_version.py"
version:from_user
git:create_tag $VERSION

View File

@ -1,57 +0,0 @@
#!/bin/bash
NEW=()
FIXES=()
MISC=()
echo "@ Fetching remote tags ..."
git fetch --tags >/dev/null
printf "\n\n"
CURTAG=$(git describe --tags --abbrev=0)
OUTPUT=$(git log $CURTAG..HEAD --oneline)
IFS=$'\n' LINES=($OUTPUT)
for LINE in "${LINES[@]}"; do
LINE=$(echo "$LINE" | sed -E "s/^[[:xdigit:]]+\s+//")
if [[ $LINE == *"new:"* ]]; then
LINE=$(echo "$LINE" | sed -E "s/^new: //")
NEW+=("$LINE")
elif [[ $LINE == *"fix:"* ]]; then
LINE=$(echo "$LINE" | sed -E "s/^fix: //")
FIXES+=("$LINE")
elif [[ $LINE != *"i did not bother commenting"* ]] && [[ $LINE != *"Merge "* ]]; then
echo " MISC LINE =$LINE"
LINE=$(echo "$LINE" | sed -E "s/^[a-z]+: //")
MISC+=("$LINE")
fi
done
if [ -n "$NEW" ]; then
echo
echo "**New Features**"
echo
for l in "${NEW[@]}"; do
echo "* $l"
done
fi
if [ -n "$FIXES" ]; then
echo
echo "**Fixes**"
echo
for l in "${FIXES[@]}"; do
echo "* $l"
done
fi
if [ -n "$MISC" ]; then
echo
echo "**Misc**"
echo
for l in "${MISC[@]}"; do
echo "* $l"
done
fi
echo

View File

@ -1,28 +0,0 @@
#!/bin/bash
# nothing to see here, just a utility i use to create new releases ^_^
VERSION_FILE=$(dirname "${BASH_SOURCE[0]}")/../pwnagotchi/_version.py
echo "version file is $VERSION_FILE"
CURRENT_VERSION=$(cat $VERSION_FILE | grep version | cut -d"'" -f2)
TO_UPDATE=(
$VERSION_FILE
)
echo -n "current version is $CURRENT_VERSION, select new version: "
read NEW_VERSION
echo "creating version $NEW_VERSION ...\n"
for file in "${TO_UPDATE[@]}"; do
echo "patching $file ..."
sed -i.bak "s/$CURRENT_VERSION/$NEW_VERSION/g" "$file"
rm -rf "$file.bak"
git add $file
done
git commit -m "releasing v$NEW_VERSION"
git push
git tag -a v$NEW_VERSION -m "release v$NEW_VERSION"
git push origin v$NEW_VERSION
echo
echo "All done, v$NEW_VERSION released ^_^"