Add release.sh

Replace xorg-util-modular's release script with our own, tailored
for Wayland only. Does the same thing but in 71 lines of code
instead of 1k. Creates a GitLab release via glab instead of trying
to upload to a web server via ssh.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2022-05-28 10:07:12 +02:00
parent 4f6c6e7c0f
commit 7cdc20cee6
2 changed files with 74 additions and 20 deletions

70
release.sh Executable file
View File

@ -0,0 +1,70 @@
#!/bin/sh -eu
build_dir=build-release
if ! type glab >/dev/null; then
echo "glab is needed to create a release"
exit 1
fi
case "$(git rev-parse --abbrev-ref HEAD)" in
main | [0-9]*.[0-9]*)
;;
*)
echo "Not on the main or a stable branch"
exit 1
esac
if [ -n "$(git log @{upstream}..)" ]; then
echo "The main branch has unpushed commits"
exit 1
fi
meson_options=""
if [ -e "$build_dir" ]; then
meson_options="$meson_options --wipe"
fi
meson setup "$build_dir" $meson_options
prev_version="$(git describe --tags --abbrev=0)"
version="$(meson introspect "$build_dir" --projectinfo | jq -r .version)"
if [ "$version" = "$prev_version" ]; then
echo "Version not bumped"
exit 1
fi
ninja -C "$build_dir" dist
archive_name="wayland-$version.tar.xz"
archive_path="$build_dir/meson-dist/$archive_name"
gpg --detach-sig "$archive_path"
sha256="$(cd $build_dir/meson-dist && sha256sum $archive_name)"
sha512="$(cd $build_dir/meson-dist && sha512sum $archive_name)"
archive_url="https://gitlab.freedesktop.org/wayland/wayland/-/releases/$version/downloads/$archive_name"
announce_path="$build_dir/meson-dist/wayland-$version-announce.eml"
cat >"$announce_path" <<EOF
To: <wayland-devel@lists.freedesktop.org>
Subject: [ANNOUNCE] wayland $version
`git shortlog --no-merges "$prev_version.."`
git tag: $version
$archive_url
SHA256: $sha256
SHA512: $sha512
PGP: $archive_url.sig
EOF
echo "Release announcement written to $announce_path"
echo -n "Release wayland $version? [y/N] "
read answer
if [ "$answer" != "y" ]; then
exit 1
fi
git tag -s -m "$version" "$version"
git push --tags
glab release create "$version" "$archive_path"* --notes ""

View File

@ -17,27 +17,11 @@ To make a release of Wayland, follow these steps.
2. Run the release.sh script to generate the tarballs, sign and
upload them, and generate a release announcement template.
This script can be obtained from X.org's modular package:
http://cgit.freedesktop.org/xorg/util/modular/tree/release.sh
The script supports a --dry-run option to test it without actually
doing a release. If the script fails on the distcheck step due to
a testsuite error that can't be fixed for some reason, you can
skip testsuite by specifying the --dist argument. Pass --help to
see other supported options.
$ release.sh .
For Wayland official and point releases, also publish the publican
documentation to wayland.freedesktop.org:
$ ./publish-doc
3. Compose the release announcements. The script will generate
*.x.y.z.announce files with a list of changes and tags. Prepend
it with a human-readable listing of the most notable changes.
For x.y.0 releases, indicate the schedule for the x.y+1.0
3. Compose the release announcements. The script will generate a
wayland-x.y.z-announce.eml file with a list of changes and tags.
Prepend it with a human-readable listing of the most notable
changes. For x.y.0 releases, indicate the schedule for the x.y+1.0
release.
4. PGP sign the release announcements and send them to