Skip to content

Commit a8fdc90

Browse files
committed
Release version 2.2.3
1 parent 82508cf commit a8fdc90

File tree

8 files changed

+122
-7
lines changed

8 files changed

+122
-7
lines changed

embedded-db-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>embedded-db-junit-parent</artifactId>
77
<groupId>org.zapodot</groupId>
8-
<version>2.2.3-SNAPSHOT</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

embedded-db-flyway/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>embedded-db-junit-parent</artifactId>
77
<groupId>org.zapodot</groupId>
8-
<version>2.2.3-SNAPSHOT</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

embedded-db-junit-jupiter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>embedded-db-junit-parent</artifactId>
77
<groupId>org.zapodot</groupId>
8-
<version>2.2.3-SNAPSHOT</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

embedded-db-junit-liquibase/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>embedded-db-junit-parent</artifactId>
77
<groupId>org.zapodot</groupId>
8-
<version>2.2.3-SNAPSHOT</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

embedded-db-junit/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.zapodot</groupId>
99
<artifactId>embedded-db-junit-parent</artifactId>
10-
<version>2.2.3-SNAPSHOT</version>
10+
<version>2.2.3</version>
1111
</parent>
1212

1313
<artifactId>embedded-db-junit</artifactId>

embedded-db-plugin-jupiter-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>embedded-db-junit-parent</artifactId>
77
<groupId>org.zapodot</groupId>
8-
<version>2.2.3-SNAPSHOT</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.zapodot</groupId>
88
<artifactId>embedded-db-junit-parent</artifactId>
99
<packaging>pom</packaging>
10-
<version>2.2.3-SNAPSHOT</version>
10+
<version>2.2.3</version>
1111
<properties>
1212
<byte-buddy.version>1.17.5</byte-buddy.version>
1313
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>

release-version.sh

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/usr/bin/env bash
2+
3+
# Funksjon for å validere semantisk versjonsnummer
4+
validate_version() {
5+
local version=$1
6+
if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$ ]]; then
7+
echo "Feil: '$version' er ikke et gyldig semantisk versjonsnummer."
8+
echo "Format: MAJOR.MINOR.PATCH (f.eks. 1.2.3, 2.0.0-beta.1)"
9+
exit 1
10+
fi
11+
}
12+
13+
# Function to increment patch version for next development cycle
14+
increment_patch_version() {
15+
local version=$1
16+
# Extract major, minor, and patch numbers
17+
local major=$(echo "$version" | cut -d. -f1)
18+
local minor=$(echo "$version" | cut -d. -f2)
19+
local patch=$(echo "$version" | cut -d. -f3 | cut -d- -f1)
20+
21+
# Increment patch version
22+
patch=$((patch + 1))
23+
24+
# Return new version
25+
echo "${major}.${minor}.${patch}"
26+
}
27+
28+
# Sjekk at versjonsnummer er oppgitt
29+
if [ $# -eq 0 ]; then
30+
echo "Usage: $0 <version_number>"
31+
echo "Example: $0 1.2.3"
32+
exit 1
33+
fi
34+
35+
VERSION=$1
36+
37+
# Valider versjonsnummer
38+
validate_version "$VERSION"
39+
40+
# Sjekk at pom.xml eksisterer
41+
if [ ! -f "pom.xml" ]; then
42+
echo "Error: could not find pom.xml in the current folder."
43+
exit 1
44+
fi
45+
46+
# Sjekk at vi er i et git-repository
47+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
48+
echo "Error: Current folgder is not a git repository."
49+
exit 1
50+
fi
51+
52+
echo "Updates version to $VERSION..."
53+
54+
# Updates version in the pom using maven versions-plugin
55+
mvn versions:set -DnewVersion="$VERSION" -DgenerateBackupPoms=false
56+
57+
# Make sure the versions-plugin was successful
58+
if [ $? -ne 0 ]; then
59+
echo "Error: Could not update version in pom.xml"
60+
exit 1
61+
fi
62+
63+
echo "Committing changes to git..."
64+
65+
# Add changes to git
66+
git add .
67+
git commit -m "Release version $VERSION"
68+
69+
# Make sure the commit was successful
70+
if [ $? -ne 0 ]; then
71+
echo "Error: Failed to commit changes"
72+
exit 1
73+
fi
74+
75+
echo "creates git-tag $VERSION..."
76+
77+
# Lag git tag
78+
git tag -a "$VERSION" -m "Release version $VERSION"
79+
80+
# Sjekk at tagging var vellykket
81+
if [ $? -ne 0 ]; then
82+
echo "Error: Could not create git tag"
83+
exit 1
84+
fi
85+
86+
# Calculate next development version by incrementing patch number
87+
NEXT_VERSION=$(increment_patch_version "$VERSION")
88+
SNAPSHOT_VERSION="${NEXT_VERSION}-SNAPSHOT"
89+
90+
echo "Preparing for next development cycle with version $SNAPSHOT_VERSION..."
91+
92+
# Set next SNAPSHOT version for development
93+
mvn versions:set -DnewVersion="$SNAPSHOT_VERSION" -DgenerateBackupPoms=false
94+
95+
# Check if the version update was successful
96+
if [ $? -ne 0 ]; then
97+
echo "Error: Could not set next development version"
98+
exit 1
99+
fi
100+
101+
echo "Committing development version changes..."
102+
103+
# Add and commit the SNAPSHOT version change
104+
git add pom.xml
105+
git commit -m "Prepare for next development iteration $SNAPSHOT_VERSION"
106+
107+
# Check if the commit was successful
108+
if [ $? -ne 0 ]; then
109+
echo "Error: Failed to commit development version changes"
110+
exit 1
111+
fi
112+
113+
echo "Success! Version $VERSION is updated, committed and tagged."
114+
echo "Next development version $SNAPSHOT_VERSION is set and committed."
115+
echo "Remember to push the changes: git push && git push --tags"

0 commit comments

Comments
 (0)