Skip to content

Commit c42d7a8

Browse files
committed
update release script
1 parent 6b4efb9 commit c42d7a8

1 file changed

Lines changed: 11 additions & 47 deletions

File tree

scripts/release.sh

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ fi
6969
echo "Running git pull to make sure we are up to date"
7070
git pull
7171

72-
# check that we are on main
73-
if ! [[ $(git status --porcelain -u no --branch) == "## main...origin/main" ]]; then
72+
# check that we are on rdf4j-4.3.x-backporting
73+
if ! [[ $(git status --porcelain -u no --branch) == "## rdf4j-4.3.x-backporting...origin/rdf4j-4.3.x-backporting" ]]; then
7474
echo""
75-
echo "You need to be on main!";
76-
echo "git checkout main";
75+
echo "You need to be on rdf4j-4.3.x-backporting!";
76+
echo "git checkout rdf4j-4.3.x-backporting";
7777
echo "";
7878
exit 1;
7979
fi
@@ -86,9 +86,9 @@ echo "Running git pull to make sure we are up to date"
8686
git pull
8787

8888
# check that we are not ahead or behind
89-
if ! [[ $(git status --porcelain -u no --branch) == "## main...origin/main" ]]; then
89+
if ! [[ $(git status --porcelain -u no --branch) == "## rdf4j-4.3.x-backporting...origin/rdf4j-4.3.x-backporting" ]]; then
9090
echo "";
91-
echo "There is something wrong with your git. It seems you are not up to date with main. Run git status";
91+
echo "There is something wrong with your git. It seems you are not up to date with rdf4j-4.3.x-backporting. Run git status";
9292
exit 1;
9393
fi
9494

@@ -110,15 +110,6 @@ fi
110110
mvn clean -Dmaven.clean.failOnError=false
111111
mvn clean -Dmaven.clean.failOnError=false
112112
mvn clean;
113-
git checkout develop;
114-
git pull;
115-
mvn clean -Dmaven.clean.failOnError=false
116-
mvn clean -Dmaven.clean.failOnError=false
117-
mvn clean;
118-
git checkout main;
119-
mvn clean -Dmaven.clean.failOnError=false
120-
mvn clean -Dmaven.clean.failOnError=false
121-
mvn clean;
122113

123114

124115
MVN_CURRENT_SNAPSHOT_VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
@@ -132,10 +123,6 @@ BRANCH="releases/${MVN_VERSION_RELEASE}"
132123

133124
RELEASE_NOTES_BRANCH="${MVN_VERSION_RELEASE}-release-notes"
134125

135-
git checkout develop
136-
MVN_VERSION_DEVELOP=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
137-
git checkout main;
138-
139126
cd scripts
140127
rm -rf temp
141128
mkdir temp
@@ -144,7 +131,6 @@ echo "MVN_VERSION_RELEASE=\"${MVN_VERSION_RELEASE}\"" > temp/constants.txt
144131
echo "MVN_NEXT_SNAPSHOT_VERSION=\"${MVN_NEXT_SNAPSHOT_VERSION}\"" > temp/constants.txt
145132
echo "BRANCH=\"${BRANCH}\"" > temp/constants.txt
146133
echo "RELEASE_NOTES_BRANCH=\"${RELEASE_NOTES_BRANCH}\"" > temp/constants.txt
147-
echo "MVN_VERSION_DEVELOP=\"${MVN_VERSION_DEVELOP}\"" > temp/constants.txt
148134
cd ..
149135

150136
echo "Running maven clean and install -DskipTests";
@@ -222,35 +208,13 @@ echo "About to create PR"
222208
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";
223209
echo "";
224210

225-
echo "Creating pull request to merge release branch back into main"
226-
gh pr create --title "next development iteration: ${MVN_NEXT_SNAPSHOT_VERSION}" --body "Merge using merge commit rather than rebase"
227-
228-
echo "";
229-
echo "Preparing a merge-branch to merge into develop"
230-
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";
231-
232-
233-
234-
git checkout "${BRANCH}"
235-
236-
git checkout -b "merge_main_into_develop_after_release_${MVN_VERSION_RELEASE}"
237-
mvn versions:set -DnewVersion="${MVN_VERSION_DEVELOP}"
238-
mvn versions:commit
239-
git commit -s -a -m "set correct version"
240-
git push --set-upstream origin "merge_main_into_develop_after_release_${MVN_VERSION_RELEASE}"
241-
242-
echo "Creating pull request to merge the merge-branch into develop"
243-
gh pr create -B develop --title "sync develop branch after release ${MVN_VERSION_RELEASE}" --body "Merge using merge commit rather than rebase"
244-
echo "It's ok to merge this PR later, so wait for the Jenkins tests to finish."
245-
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";
211+
echo "Creating pull request to merge release branch back into rdf4j-4.3.x-backporting"
212+
gh pr create --title "next development iteration: ${MVN_NEXT_SNAPSHOT_VERSION}" --body "Merge using merge commit rather than rebase" --base rdf4j-4.3.x-backporting
246213

247214
mvn clean -Dmaven.clean.failOnError=false
248215
mvn clean -Dmaven.clean.failOnError=false
249216

250-
git checkout develop
251-
mvn clean -Dmaven.clean.failOnError=false
252-
mvn clean -Dmaven.clean.failOnError=false
253-
git checkout main
217+
git checkout rdf4j-4.3.x-backporting
254218
mvn clean -Dmaven.clean.failOnError=false
255219
mvn clean -Dmaven.clean.failOnError=false
256220

@@ -269,7 +233,7 @@ set -e
269233
mvn package -Passembly -DskipTests
270234

271235

272-
git checkout main
236+
git checkout rdf4j-4.3.x-backporting
273237
git checkout -b "${RELEASE_NOTES_BRANCH}"
274238

275239
tar -cvzf "site/static/javadoc/${MVN_VERSION_RELEASE}.tgz" -C target/site/apidocs .
@@ -281,7 +245,7 @@ gh pr create -B main --title "${RELEASE_NOTES_BRANCH}" --body "Javadocs, release
281245

282246
echo "Javadocs are in git branch ${RELEASE_NOTES_BRANCH}"
283247

284-
git checkout main
248+
git checkout rdf4j-4.3.x-backporting
285249
mvn clean
286250

287251
cd scripts

0 commit comments

Comments
 (0)