From patchwork Wed Sep 20 09:53:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1837149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=i50kMEVA; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=hcvxTrBc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RrDPb0RMZz1yhR for ; Wed, 20 Sep 2023 19:53:39 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 11D5A3CE3DE for ; Wed, 20 Sep 2023 11:53:37 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id BD89A3CDEB8 for ; Wed, 20 Sep 2023 11:53:23 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id C978F1A02361 for ; Wed, 20 Sep 2023 11:53:22 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2BA5A1FE96; Wed, 20 Sep 2023 09:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1695203602; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M0KyA/j52QNnt2UOvkM9p5AbrL0OhvAS4eKBSepPhzM=; b=i50kMEVArCku/fy3jU+cH8CDiB0V4A/7SL7fYonrOABOeg0ji23S7/4zBXTry/1GRuaLxP xchuminG/QvHAUqqZsqjml4+xrzV5RZ2iJsOf4ZKvsGvpsspmRfsdh4z041v//EZuImPU+ TdY+dP+F8X1bBEaG5kRaoB12JdQzc0Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1695203602; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M0KyA/j52QNnt2UOvkM9p5AbrL0OhvAS4eKBSepPhzM=; b=hcvxTrBcLx2TJikCRPYvdCwYB5KD8pp8sganPgsqtou+TrCbynAy0ZAU7tz1UoFC3GI8cc It56Nc+wneisXzBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E49131333E; Wed, 20 Sep 2023 09:53:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QFS8NhHBCmVpBQAAMHmgww (envelope-from ); Wed, 20 Sep 2023 09:53:21 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Wed, 20 Sep 2023 11:53:14 +0200 Message-Id: <20230920095318.340582-2-pvorel@suse.cz> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920095318.340582-1-pvorel@suse.cz> References: <20230920095318.340582-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 1/5] tools: Add a script for tagging the release X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Palethorpe , Xiao Yang Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" A helper for new releases. Functions will be reused in another script (next commit). Signed-off-by: Petr Vorel --- tools/lib.sh | 31 +++++++++++++++++ tools/tag-release.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100755 tools/lib.sh create mode 100755 tools/tag-release.sh diff --git a/tools/lib.sh b/tools/lib.sh new file mode 100755 index 000000000..c96433d28 --- /dev/null +++ b/tools/lib.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# Copyright (c) 2023 Petr Vorel + +ask() +{ + local msg="$1" + local answer + + printf "\n$msg. Proceed? [N/y]: " + read answer + case "$answer" in + [Yy]*) : ;; + *) exit 2 + esac +} + +quit() +{ + printf "\n$@\n" >&2 + exit 1 +} + +rod() +{ + eval "$@" || quit "$@ failed" +} + +title() +{ + echo "===== $1 =====" +} diff --git a/tools/tag-release.sh b/tools/tag-release.sh new file mode 100755 index 000000000..18bef4b17 --- /dev/null +++ b/tools/tag-release.sh @@ -0,0 +1,80 @@ +#!/bin/sh +# Copyright (c) 2023 Petr Vorel +# Tag LTP release. +# https://github.com/linux-test-project/ltp/wiki/LTP-Release-Procedure +set -e + +upstream_git="linux-test-project/ltp" +tag="$(date +%Y%m%d)" +old_tag="$(git describe --abbrev=0)" +tag_msg="LTP $tag" +relnotes="/tmp/$(basename $upstream_git)-release-$tag" + +. $(dirname "$0")/lib.sh + +cd $(dirname "$0")/.. + +if ! git ls-remote --get-url origin | grep -q $upstream_git; then + quit "Not an upstream project" +fi + +if ! git --no-pager diff --exit-code; then + quit "Please commit your changes before making new release" +fi + +if git show $tag 2> /dev/null; then + quit "Tag '$tag' already exists" +fi + +if grep -q "$tag" VERSION; then + quit "Tag '$tag' already in VERSION file" +fi + +title "git tag" +echo "new tag: '$tag', previous tag: '$old_tag'" +echo "$tag" > VERSION +git add VERSION +rod git commit -S --signoff --message \"$tag_msg\" VERSION +rod git tag --sign --annotate $tag --message \"$tag_msg\" +git --no-pager show $tag --show-signature + +ask "Please check tag and signature" + +title "Creating skeleton file for release notes" +cat > $relnotes <> $relnotes + +cat >> $relnotes <> $relnotes + +cat >> $relnotes <> $relnotes +echo '```' >> $relnotes + +echo "Skeleton file for release notes: $relnotes" + +title "git push" +ask "Pushing changes to upstream git" +rod git push origin master:master +git push origin $tag