From patchwork Thu Oct 13 09:59:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17593 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id EBAF5C3286 for ; Thu, 13 Oct 2022 10:00:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3FCAA62DA6; Thu, 13 Oct 2022 12:00:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665655207; bh=drqcbLpGgjAQ435jNKUnbsqEYzqiMArqg5oNyQWTv9o=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=3BBrbuJtcTDp+fTat12cFVnlPOqp7mKq9jBWYldyVMOkZA8YwU5nM5HYbFQm7vhr1 8Nm/wtnpdwJkIqP63tMRek4NJwP7fT2Xd7xcHjISz9XSptc6qEbMcGQR/AeHREz/oA zT5qYCeM35mciK5dwTLpFRku5nDrLamN654dHhSQUHpySFGc5xAfHfcK2taFIcyoFB PLRWk/NHaVOb/jcV8FEDJihqSWa2qWmRK+bgUmxVWgjieZEiAvntDZ/Yk66xRPcidQ UePTb6FjKVz3EIgG0+VgzO38OOduC702PFRny/PZCmeA1lNTFq/BtdueHYk6yF58uA aR42r6GZ99w1Q== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C189262D6B for ; Thu, 13 Oct 2022 12:00:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oSvIizoh"; dkim-atps=neutral Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3EEB2CCE; Thu, 13 Oct 2022 12:00:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665655202; bh=drqcbLpGgjAQ435jNKUnbsqEYzqiMArqg5oNyQWTv9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSvIizohhSSoNu2v8/MQaEq1TORXVKP9gP2AjraEBXqijV7Oa/c4mkyqYaYOh+azX AFDoRxB4D3RvxoEKztTWQTqNnza7wD+BjUoIeh4Y3M6fYQZmPVZDFNvZgB0uf49GMx AysDxB6329UhstUiBCEaZQ6eh6rT8x47uw+lndNw= To: libcamera devel Date: Thu, 13 Oct 2022 10:59:57 +0100 Message-Id: <20221013095957.1642901-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221013095957.1642901-1-kieran.bingham@ideasonboard.com> References: <20221013095957.1642901-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 3/3] utils: Provide a release script X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Support making releases of libcamera by introducing a helper script which will facilitate the increment of any release version, along with generating an associated tag. Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- v4 - Set -e on script to stop on any errors - Use -e when creating the release commit to support the releaser adding notes - Take the commit message into the signed tag as the release message (No signoffs are stripped) v3 - Improve error message - Remove redundant git add Signed-off-by: Kieran Bingham --- utils/release.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 utils/release.sh diff --git a/utils/release.sh b/utils/release.sh new file mode 100755 index 000000000000..6b4e081ba179 --- /dev/null +++ b/utils/release.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# SPDX-License-Identifier: GPL-2.0-or-later +# Prepare a project release + +set -e + +# Abort if we are not within the project root or the tree is not clean. +if [ ! -e utils/gen-version.sh ] || [ ! -e .git ]; then + echo "This release script must be run from the root of libcamera git tree." + exit 1 +fi + +if ! git diff-index --quiet HEAD; then + echo "Tree must be clean to release." + exit 1 +fi + +# Identify current version components +version=$(./utils/gen-version.sh) + +# Decide if we are here to bump major, minor, or patch release. +case $1 in + major|minor|patch) + bump=$1; + ;; + *) + echo "You must specify the version bump level: (major, minor, patch)" + exit 1 + ;; +esac + +new_version=$(./utils/semver bump "$bump" "$version") + +echo "Bumping $bump" +echo " Existing version is: $version" +echo " New version is : $new_version" + +# Patch in the version to our meson.build +sed -i -E "s/ version : '.*',/ version : '$new_version',/" meson.build + +# Commit the update +git commit meson.build -esm "libcamera v$new_version" + +# Create a tag from that commit +git show -s --format=%B | git tag "v$new_version" -as -F -