From b4df355506fa3bbdff0cd8da65e5e81f6e42b785 Mon Sep 17 00:00:00 2001 From: Klaus Hartl Date: Sun, 19 Feb 2023 12:46:50 +0100 Subject: [PATCH] Automate creating GitHub release Creating a release draft, so that I can manually add release notes. --- run.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/run.sh b/run.sh index 2f0d0a1..6bcc84a 100755 --- a/run.sh +++ b/run.sh @@ -6,10 +6,6 @@ _user() { printf "\033[0;33m%s\033[0m" "$1" } -_success() { - printf "\033[0;32m==> %s\033[0m\n\n" "$1" -} - _fail() { printf "\033[0;31m==> %s\033[0m\n\n" "$1" } @@ -22,7 +18,7 @@ prep_release() { grep -rlZE 'v\d+\.\d+\.\d+' --exclude=Dockerfile --exclude-dir=.git . | xargs sed -i '' 's/v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"$1"'/g' - _user "Push? " + _user "Prepare release draft on GitHub? " read -r answer if [ "$answer" = "y" ]; then git add --update @@ -30,7 +26,8 @@ prep_release() { git push origin main git tag -s "$1" -m "Release $1" git push --tags - _success "Tag for release $1 available!" + gh release create --draft --latest --title "$1" --verify-tag + gh release view "$1" --web fi } @@ -38,7 +35,7 @@ _help() { echo "Usage: ./run.sh [command]" echo "" echo "Available commands:" - echo "prep-release Prepare new release" + echo "prep-release Prepare new release draft" } cmd="${1:-}"