diff options
author | 2024-02-24 14:48:25 +0100 | |
---|---|---|
committer | 2024-02-26 09:02:06 -0500 | |
commit | 829c75b9c95e6cf7c7a1e02528966ef842ea3d4c (patch) | |
tree | 7ade16707afe48481b1c1dce6a2019d584355a16 /release.sh | |
parent | Define _POSIX_C_SOURCE globally (diff) | |
download | sway-829c75b9c95e6cf7c7a1e02528966ef842ea3d4c.tar.gz sway-829c75b9c95e6cf7c7a1e02528966ef842ea3d4c.tar.zst sway-829c75b9c95e6cf7c7a1e02528966ef842ea3d4c.zip |
Add release script
Diffstat (limited to 'release.sh')
-rwxr-xr-x | release.sh | 31 |
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 @@ | |||
1 | #!/bin/sh -eu | ||
2 | |||
3 | prev=$(git describe --tags --abbrev=0) | ||
4 | next=$(meson rewrite kwargs info project / 2>&1 >/dev/null | jq -r '.kwargs["project#/"].version') | ||
5 | |||
6 | case "$next" in | ||
7 | *-dev) | ||
8 | echo "This is a development version" | ||
9 | exit 1 | ||
10 | ;; | ||
11 | esac | ||
12 | |||
13 | if [ "$prev" = "$next" ]; then | ||
14 | echo "Version not bumped in meson.build" | ||
15 | exit 1 | ||
16 | fi | ||
17 | |||
18 | if ! git diff-index --quiet HEAD -- meson.build; then | ||
19 | echo "meson.build not committed" | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | shortlog="$(git shortlog --no-merges "$prev..")" | ||
24 | (echo "sway $next"; echo ""; echo "$shortlog") | git tag "$next" -ase -F - | ||
25 | |||
26 | prefix=sway-$next | ||
27 | archive=$prefix.tar.gz | ||
28 | git archive --prefix="$prefix/" -o "$archive" "$next" | ||
29 | gpg --output "$archive".sig --detach-sig "$archive" | ||
30 | |||
31 | gh release create "sway $next" -t "$next" -n "" -d "$archive" "$archive.sig" | ||