From 7cdc20cee6cb967c1975896cb60bcc9d1221819a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 28 May 2022 10:07:12 +0200 Subject: [PATCH] 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 --- release.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ releasing.txt | 24 +++--------------- 2 files changed, 74 insertions(+), 20 deletions(-) create mode 100755 release.sh diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..59e6eb0 --- /dev/null +++ b/release.sh @@ -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" < +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 "" diff --git a/releasing.txt b/releasing.txt index db87971..e93f53d 100644 --- a/releasing.txt +++ b/releasing.txt @@ -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