summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeffreytse2021-06-08 18:28:12 +0800
committerjeffreytse2021-06-08 18:28:12 +0800
commit93575ebbaaa55b4a91873af7d9422f3004737a2c (patch)
tree4ff00a7d0e8d10f2c34a2754e718ef53c5daa07e
parent148afbb2fac3d108a501a704b538ac3b4e79b5e8 (diff)
downloadaur-93575ebbaaa55b4a91873af7d9422f3004737a2c.tar.gz
feat: add a release script
-rwxr-xr-xrelease46
1 files changed, 46 insertions, 0 deletions
diff --git a/release b/release
new file mode 100755
index 00000000000..080db8b9711
--- /dev/null
+++ b/release
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+pkgver="$1"
+
+if [ -z $1 ]; then
+ echo 'Version is empty! For example: ./release x.x.x'
+ exit 1;
+fi
+
+if [[ ${pkgver:0:1} != 'v' ]]; then
+ pkgver="v$pkgver"
+fi
+
+filename="$pkgver.tar.gz"
+
+echo 'Downlading archive file...'
+
+wget "https://github.com/jeffreytse/zsh-vi-mode/archive/$filename" -q -O \
+ ./$filename
+
+sha256sum=($(sha256sum $filename))
+
+echo 'Updating PKGBUILD...'
+sed -i "s/pkgver=.*/pkgver=$pkgver/" ./PKGBUILD
+sed -i "s/sha256sums=.*/sha256sums=('$sha256sum')/" ./PKGBUILD
+
+echo 'Generating .SRCINFO...'
+makepkg --printsrcinfo > .SRCINFO
+
+echo 'Cleanup archive file...'
+rm -f $filename
+
+read -p "Do you want to release it immediately? [y/N]" \
+ -n 1 -r
+
+echo
+
+case "$REPLY" in
+ y|Y)
+ git add PKGBUILD .SRCINFO
+ git commit -m "release: $pkgver"
+ echo 'Release AUR package successfully!'
+ ;;
+esac
+
+echo 'Finished!'