From patchwork Fri Sep 30 23:28:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17481 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 B4130C3280 for ; Fri, 30 Sep 2022 23:28:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7E3A76286A; Sat, 1 Oct 2022 01:28:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664580519; bh=FEgtk/B2rLPZcZ3AJ+/Rz7Qo232MLJGHEyQxaasyDR8=; 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=Y52xQ1jVUxTHOF2J7Du3zvoUJgRXJjgWVfNUbyXhM2Y3Q187Luastlj7YED2ghClj PoQmftjex4ya+fxL5/lV0e+F88shderQ8huI9mujBebSFU1+pEJNeNZODyWqFz72K3 HGtOIIu9qA3qBLjmIxqKhPiAV0e1oJdNgLIk7rlJq7v8TYPYLt+iKlw7bjRlhkjw3p ZbBAbBt7yYEcJUnIPfAOAnsy4jKXNEgmM6W7bdYjhxhQyOdm5qtWZH3/BWqbHLEqzv AWSwP6wZju0l2pWWv9mL8bPnmtmfcfdJQB7iWM82PuhI5yW5VUtBt7LvwXeFUN3d0N gEYn6fJO0wKOg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E6976285B for ; Sat, 1 Oct 2022 01:28:36 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cxd+4axO"; dkim-atps=neutral Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 14C0710BB; Sat, 1 Oct 2022 01:28:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664580516; bh=FEgtk/B2rLPZcZ3AJ+/Rz7Qo232MLJGHEyQxaasyDR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cxd+4axOCRLFS3NuAxQkKX4+yzTBTHchq8jh3nSjImI2ZnLUnoz037Ky5+v9qAfEE oFuSAPmTk+up210oFIXeaKatHjIsArrlOW3BXQjBNZWxbAp+Y4RARGpkiQptyRxibh UYqUaMqOOICxER5JF0ESBA/9eltcF1HsW7hQ9iF4= To: libcamera devel Date: Sat, 1 Oct 2022 00:28:26 +0100 Message-Id: <20220930232826.82753-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220930232826.82753-1-kieran.bingham@ideasonboard.com> References: <20220930232826.82753-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 5/5] 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 Signed-off-by: Kieran Bingham --- This can later be extended to support or enforce adding an overview changelog to the commit, and annotated tag. utils/release.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 utils/release.sh diff --git a/utils/release.sh b/utils/release.sh new file mode 100755 index 000000000000..13df8457eaa2 --- /dev/null +++ b/utils/release.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# SPDX-License-Identifier: GPL-2.0-or-later +# Prepare a project release + +# 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 clone." + 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 add meson.build +git commit meson.build -sm "libcamera v$new_version" + +# Create a tag +git tag "v$new_version" -asm "libcamera v$new_version"