File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Accept the version as a command-line argument
4
+ version=$1
5
+
6
+ # Find the line number where the version is mentioned
7
+ start=$( grep -n " \[$version \]" CHANGELOG.md | cut -d : -f 1)
8
+
9
+ # If the version is not found, use "Unreleased"
10
+ if [ -z " $start " ]; then
11
+ version=" Unreleased"
12
+ start=$( grep -n " \[$version \]" CHANGELOG.md | cut -d : -f 1)
13
+ fi
14
+
15
+ # Increment the start line to skip the version line
16
+ start=$(( start + 1 ))
17
+
18
+ # Find the line number of the next version
19
+ end=$( awk -v start=$start ' NR > start && /\[.*\]/ {print NR; exit}' CHANGELOG.md)
20
+
21
+ # If the next version is not found, print until the end of the file
22
+ if [ -z " $end " ]; then
23
+ awk -v start=$start ' NR >= start' CHANGELOG.md
24
+ else
25
+ awk -v start=$start -v end=$end ' NR >= start && NR < end' CHANGELOG.md
26
+ fi
Original file line number Diff line number Diff line change
1
+ # Check if the file exists
2
+ MAVEN_CENTRAL_USERNAME=$1
3
+ MAVEN_CENTRAL_PASSWORD=$2
4
+ if [ ! -f " gradle.properties" ]; then
5
+ echo " gradle.properties does not exist."
6
+ exit 1
7
+ fi
8
+ # Append -SNAPSHOT to the VERSION_NAME
9
+ sed -i -e ' /VERSION_NAME/s/$/-SNAPSHOT/' " gradle.properties"
10
+
11
+ ./gradlew publishAllPublicationsToMavenCentralRepository \
12
+ -PmavenCentralUsername=" $MAVEN_CENTRAL_USERNAME " \
13
+ -PmavenCentralPassword=" $MAVEN_CENTRAL_PASSWORD "
You can’t perform that action at this time.
0 commit comments