From patchwork Thu Sep 29 14:36: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: 17467 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 4BA04C327F for ; Thu, 29 Sep 2022 14:36:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A731762397; Thu, 29 Sep 2022 16:36:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664462199; bh=HS6dLeNXvnCWRBvEyRdWJQOq814NQLrD1Jb47TDgnwc=; 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=x6x6T5HODzHKomu3zGqotZXHUMr/bjducUHTFURCfaprL+UkjbIKPaO0OLxMAHMIg hZ9tLFpb/xGDuAxnreqCBi1yeHuL0RGmq+4qiO1AgpqwlOg7LEDFdqdUYS2scE5R1s UxOjVnoo/bVq30KosZvC3celLE4NRwnrq2juX0GyBklmXfevCeL4kbXalxqVa9M29E snrT4577m1J2zHIpT2H5+JowlrOd01+3CYr9zmVfZ8lhs/XBRiYEiBNzxMwuenSX0y bftBx6GlPPUBdAJCLls1BQC7tgMLg5b9zj/vVGVVzuFOordGVnSQWV9DkE4h29Q3wq yCT10IM1N+qmQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B1FF62391 for ; Thu, 29 Sep 2022 16:36:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jTXpMd+O"; 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 34EF087A; Thu, 29 Sep 2022 16:36:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664462195; bh=HS6dLeNXvnCWRBvEyRdWJQOq814NQLrD1Jb47TDgnwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jTXpMd+O9Q3gsE0ayXeoBDNFS0MrwstcTLZ/XRFpAzdwEE7XGM6NONmTM/4lKk3iM bKWe2f+hV6QWiVbMBFAUwI9sWFg42enVIJdUQYGsyd/44aOPxv9WiITttVbM4xX4nn MS8prjJXTBo0T1teNWE4YtVT7u80Zvk1B1/yrlM4= To: libcamera devel Date: Thu, 29 Sep 2022 15:36:26 +0100 Message-Id: <20220929143626.3100668-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220929143626.3100668-1-kieran.bingham@ideasonboard.com> References: <20220929143626.3100668-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/4] 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. Signed-off-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- This can later be extended to support or enforce adding an overview changelog to the commit, and annotated tag. utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 utils/release.sh diff --git a/utils/release.sh b/utils/release.sh new file mode 100755 index 000000000000..c1c35dacab8e --- /dev/null +++ b/utils/release.sh @@ -0,0 +1,48 @@ +#!/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 -o ! -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:" + echo " - major" + echo " - minor" + echo " - 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 -m "libcamera v$new_version" + +# Create a tag +git tag v$new_version -am "libcamera v$new_version"