forked from eclipse/kuksa.val
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_release.sh
executable file
·41 lines (35 loc) · 1.33 KB
/
prepare_release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#********************************************************************************
# Copyright (c) 2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License 2.0 which is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#*******************************************************************************/
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <version>"
exit 1
fi
VERSION_REGEX="[0-9]+\.[0-9]+(\.[0-9]+)?"
VERSION="$1"
if [ "$(echo "$1" | sed -E "s/$VERSION_REGEX//")" ]; then
echo "<version> should be of the form MAJOR.MINOR[.PATCH]"
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
DATA_BROKER_ROOT="$SCRIPT_DIR"
# Update Cargo.toml versions.
sed -i -E "s/^version = \"${VERSION_REGEX}\"$/version = \"${VERSION}\"/" \
"$DATA_BROKER_ROOT/databroker/Cargo.toml" \
"$DATA_BROKER_ROOT/databroker-api/Cargo.toml" \
"$DATA_BROKER_ROOT/databroker-cli/Cargo.toml" \
"$DATA_BROKER_ROOT/databroker-examples/Cargo.toml"
# Create release commit and tag it
#git commit -a -m "Release ${VERSION}"
#git tag -a "v${VERSION}" -m "Release ${VERSION}"