Debian Codegraph @

tools/create_release.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 # Create git tag
3 #
4 # SPDX-FileCopyrightText: 2024 Johnny Jazeix <[email protected]>
5 #
6 # SPDX-License-Identifier: GPL-3.0-or-later
7
8 function usagescip-shell shell shell-project 0.0.0 usage().() {
9 echoscip-shell system . . echo. "Usage: ./tools/create_release.sh -v <version> [-r <date>] [-h]"
10 echoscip-shell system . . echo. " -v, --version <version> contains the new version <major>.<minor>.<patch>"
11 echoscip-shell system . . echo. " -r, --release <date> contains the date of the release YYYY-MM-DD (optional)"
12 echoscip-shell system . . echo. " -h, --help displays this help"
13 }
14
15 if [scip-shell system . . `[`. ! -f io.github.petitlapin.Li-ri.appdata.xml ]
16 then
17 echoscip-shell system . . echo. "ERROR: Run me from the top level source dir"
18 exit 1
19 fi
20
21 while [[ $# -gt 0 ]]; do
22 case $1 in
23 -v|--version)
24 VERSION="$2"
25 shift # past argument
26 shift # past value
27 ;;
28 -r|--release)
29 DATE="$2"
30 shift # past argument
31 shift # past value
32 ;;
33 -h|--help)
34 usagescip-shell shell shell-project 0.0.0 usage().;
35 exit 0
36 ;;
37 -*|--*)
38 echoscip-shell system . . echo. "Unknown option $1"
39 exit 1
40 ;;
41 *)
42 POSITIONAL_ARGS+=("$1") # save positional arg
43 shift # past argument
44 ;;
45 esac
46 done
47
48 if [[ ! "${VERSION}" ]]
49 then
50 echoscip-shell system . . echo. "Mission version"
51 usagescip-shell shell shell-project 0.0.0 usage().
52 exit 1
53 fi
54
55 major=`echoscip-shell system . . echo. $VERSION | cutscip-shell system . . cut. -d. -f1`
56 minor=`echoscip-shell system . . echo. $VERSION | cutscip-shell system . . cut. -d. -f2`
57 patch=`echoscip-shell system . . echo. $VERSION | cutscip-shell system . . cut. -d. -f3`
58
59 version=${major}.${minor}.${patch}
60 echoscip-shell system . . echo. "Version = $version"
61 echoscip-shell system . . echo. "Date = ${DATE}"
62
63 ./tools/bump_version.sh -v ${VERSION} -c
64
65 # TODO
66 if [[ "${CHANGELOG}" ]]
67 then
68 gitscip-shell system . . git. tag -a v${VERSION} -m "create tag v${VERSION}"
69 fi