From patchwork Mon Oct 10 17:32:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17577 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 906FCC3287 for ; Mon, 10 Oct 2022 17:33:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4943D62D77; Mon, 10 Oct 2022 19:33:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665423209; bh=IZrxl9jbE6qf0uXqz/uMRLuoPIyzIBAZmJ+Q1Ninstk=; 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=FA2G2cxNWLSmT49BXNyJFNEz+ANC7Yhw0Pt9LjFHSsAWZ0asA413GN88TK/VeU+u/ lschx8JAnNaTypdi3KlK8GIGUVEENmmlfEwIM4xgzyoZcJg3+4UM7TtHwOfokg8lJ+ s5pwF6AAu/aiattx2926yPA/CM+obPXuXd4gYkmnNxJYWrD6JTw6E0cozs0sMlWIuF vj/yUTvqCfdAmF2nLzqBmYuqQnbCFByED2Pq5DYBRLBa6XqPdpiK4qY5fL3m0cecFp WNtn83YqgK9EJbW3ffM1+dump8ucNcSKLTl/3fX+qhV7lYKIR54BqXHn0bScILpNZD ++urbsLtqGaaw== 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 A101E62D72 for ; Mon, 10 Oct 2022 19:33:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rLVCpJ2M"; 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 376DBBB0; Mon, 10 Oct 2022 19:33:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665423204; bh=IZrxl9jbE6qf0uXqz/uMRLuoPIyzIBAZmJ+Q1Ninstk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rLVCpJ2MUshl2G8Ht28z5U4vVehahh4hHg1K/YPePE+6xsLQWdSQ/4TXvp2E3qWCw 077UlG8keGA9DHfLBpUlsTv2yRi5BBKFoJUtmzPEJsOBIBk/DnNPRvobh6lkoK7IVV FbSK42VUW9T6nZHfzRL57J8P8Fis30lFmxXPBEJM= To: libcamera devel Date: Mon, 10 Oct 2022 18:32:14 +0100 Message-Id: <20221010173214.3547133-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221010173214.3547133-1-kieran.bingham@ideasonboard.com> References: <20221010173214.3547133-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 Reviewed-by: Laurent Pinchart --- v3 - Improve error message - Remove redundant git add Signed-off-by: Kieran Bingham --- utils/release.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 utils/release.sh diff --git a/utils/release.sh b/utils/release.sh new file mode 100755 index 000000000000..14d62aa6005f --- /dev/null +++ b/utils/release.sh @@ -0,0 +1,44 @@ +#!/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 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 -sm "libcamera v$new_version" + +# Create a tag +git tag "v$new_version" -asm "libcamera v$new_version"