From 68fef9922edd9add56d97c5bb4d64b6a3179764b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 6 Sep 2022 15:05:37 +0200 Subject: [PATCH] build: Make release.sh generic The "release.sh" script is a convenient and documented way to release Wayland packages. Unfortunately, the actual package name is hardcoded, meaning that to reuse that script in other Wayland projects, one needs to duplicate the script and amend it. Use meson to determine the actual project name, so that the same script can be invoked from any relevant Wayland project. Signed-off-by: Olivier Fourdan --- release.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/release.sh b/release.sh index 59e6eb07..697bf40a 100755 --- a/release.sh +++ b/release.sh @@ -33,19 +33,25 @@ if [ "$version" = "$prev_version" ]; then exit 1 fi +name="$(meson introspect "$build_dir" --projectinfo | jq -r .descriptive_name)" +if [ "$name" = "" ]; then + echo "Cannot determine project name" + exit 1 +fi + ninja -C "$build_dir" dist -archive_name="wayland-$version.tar.xz" +archive_name="$name-$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" +archive_url="https://gitlab.freedesktop.org/wayland/$name/-/releases/$version/downloads/$archive_name" +announce_path="$build_dir/meson-dist/$name-$version-announce.eml" cat >"$announce_path" < -Subject: [ANNOUNCE] wayland $version +Subject: [ANNOUNCE] $name $version `git shortlog --no-merges "$prev_version.."` @@ -59,7 +65,7 @@ EOF echo "Release announcement written to $announce_path" -echo -n "Release wayland $version? [y/N] " +echo -n "Release $name $version? [y/N] " read answer if [ "$answer" != "y" ]; then exit 1