aboutsummaryrefslogtreecommitdiff
path: root/release.sh
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2024-02-24 14:48:25 +0100
committerSimon Zeni <simon@bl4ckb0ne.ca>2024-02-26 09:02:06 -0500
commit829c75b9c95e6cf7c7a1e02528966ef842ea3d4c (patch)
tree7ade16707afe48481b1c1dce6a2019d584355a16 /release.sh
parentfc640d5f6c82883c35e90a64f0098486e6091293 (diff)
Add release script
Diffstat (limited to 'release.sh')
-rwxr-xr-xrelease.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/release.sh b/release.sh
new file mode 100755
index 00000000..62baf415
--- /dev/null
+++ b/release.sh
@@ -0,0 +1,31 @@
+#!/bin/sh -eu
+
+prev=$(git describe --tags --abbrev=0)
+next=$(meson rewrite kwargs info project / 2>&1 >/dev/null | jq -r '.kwargs["project#/"].version')
+
+case "$next" in
+*-dev)
+ echo "This is a development version"
+ exit 1
+ ;;
+esac
+
+if [ "$prev" = "$next" ]; then
+ echo "Version not bumped in meson.build"
+ exit 1
+fi
+
+if ! git diff-index --quiet HEAD -- meson.build; then
+ echo "meson.build not committed"
+ exit 1
+fi
+
+shortlog="$(git shortlog --no-merges "$prev..")"
+(echo "sway $next"; echo ""; echo "$shortlog") | git tag "$next" -ase -F -
+
+prefix=sway-$next
+archive=$prefix.tar.gz
+git archive --prefix="$prefix/" -o "$archive" "$next"
+gpg --output "$archive".sig --detach-sig "$archive"
+
+gh release create "sway $next" -t "$next" -n "" -d "$archive" "$archive.sig"