Skip to content

Commit

Permalink
Adjust release template and scripts (eclipse-rdf4j#4729)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad authored Aug 6, 2023
1 parent bf6d0b0 commit 3569066
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
31 changes: 24 additions & 7 deletions scripts/milestone-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ if ! command -v xmllint &> /dev/null; then
exit 1;
fi

echo "Running git pull to make sure we are up to date"
git pull

# check that we are on main or develop
if ! git status --porcelain --branch | grep -q "## main...origin/main"; then
if ! git status --porcelain --branch | grep -q "## develop...origin/develop"; then
if ! [[ $(git status --porcelain -u no --branch) == "## main...origin/main" ]]; then
if ! [[ $(git status --porcelain -u no --branch) == "## develop...origin/develop" ]]; then
echo""
echo "You need to be on main or develop!";
echo "";
Expand All @@ -65,18 +68,18 @@ if ! git status --porcelain --branch | grep -q "## main...origin/main"; then
fi

ORIGINAL_BRANCH=""
if git status --porcelain --branch | grep -q "## main...origin/main"; then
if ! [[ $(git status --porcelain -u no --branch) == "## main...origin/main" ]]; then
ORIGINAL_BRANCH="main";
fi
if git status --porcelain --branch | grep -q "## develop...origin/develop"; then
if ! [[ $(git status --porcelain -u no --branch) == "## develop...origin/develop" ]]; then
ORIGINAL_BRANCH="develop";
fi

echo "Running git pull to make sure we are up to date"
git checkout develop
git pull

if ! git status --porcelain --branch | grep -q "## develop...origin/develop"; then
if ! [[ $(git status --porcelain -u no --branch) == "## develop...origin/develop" ]]; then
echo""
echo "There is something wrong with your git. It seems you are not up to date with develop. Run git status";
echo "";
Expand All @@ -86,7 +89,7 @@ fi
git checkout main
git pull

if ! git status --porcelain --branch | grep -q "## main...origin/main"; then
if ! [[ $(git status --porcelain -u no --branch) == "## main...origin/main" ]]; then
echo""
echo "There is something wrong with your git. It seems you are not up to date with main. Run git status";
echo "";
Expand All @@ -113,6 +116,8 @@ fi


echo "Running maven clean and install -DskipTests";
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean;
mvn install -DskipTests;

Expand Down Expand Up @@ -172,20 +177,32 @@ echo "(if you are on linux or windows, remember to use CTRL+SHIFT+C to copy)."
echo "Log in, then choose 'Build with Parameters' and type in ${MVN_VERSION_RELEASE}"
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";

mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false

git checkout develop
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false

git checkout main
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false


echo "Build javadocs"
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";

git checkout "${MVN_VERSION_RELEASE}"
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false

# temporarily disable exiting on error
set +e
mvn clean
mvn compile -Pquick -Dmaven.compiler.failOnError=false
mvn compile -DskipTests
mvn package -Passembly -DskipTests
set -e

mvn package -Passembly -DskipTests

git checkout main
Expand Down
21 changes: 19 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ if ! command -v xmllint &> /dev/null; then
exit 1;
fi

echo "Running git pull to make sure we are up to date"
git pull

# check that we are on main
if ! git status --porcelain --branch | grep -q "## main...origin/main"; then
if ! [[ $(git status --porcelain -u no --branch) == "## main...origin/main" ]]; then
echo""
echo "You need to be on main!";
echo "git checkout main";
echo "";
exit 1;
fi

mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean;

echo "Running git pull to make sure we are up to date"
Expand Down Expand Up @@ -102,12 +107,17 @@ if ! git push --dry-run > /dev/null 2>&1; then
exit 1;
fi

mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean;
git checkout develop;
mvn clean;
git pull;
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean;
git checkout main;
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean;


Expand Down Expand Up @@ -138,6 +148,8 @@ echo "MVN_VERSION_DEVELOP=\"${MVN_VERSION_DEVELOP}\"" > temp/constants.txt
cd ..

echo "Running maven clean and install -DskipTests";
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean;
mvn install -DskipTests;

Expand Down Expand Up @@ -183,6 +195,8 @@ echo "Log in, then choose 'Build with Parameters' and type in ${MVN_VERSION_RELE
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";

# Cleanup
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
mvn clean

# Set a new SNAPSHOT version
Expand Down Expand Up @@ -230,12 +244,15 @@ gh pr create -B develop --title "sync develop branch after release ${MVN_VERSION
echo "It's ok to merge this PR later, so wait for the Jenkins tests to finish."
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";

mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false

git checkout develop
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false
git checkout main
mvn clean -Dmaven.clean.failOnError=false
mvn clean -Dmaven.clean.failOnError=false

echo "Build javadocs"
read -n 1 -srp "Press any key to continue (ctrl+c to cancel)"; printf "\n\n";
Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/patch-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ RDF4J ${MVN_VERSION_RELEASE} is a patch release that fixes ${NUMBER_OF_CLOSED_IS

For a complete overview, see [all issues fixed in ${MVN_VERSION_RELEASE}](https://github.com/eclipse/rdf4j/milestone/${GITHUB_MILESTONE}?closed=1).

## Acknowledgements
### Acknowledgements

This release was made possible by contributions from ???

0 comments on commit 3569066

Please sign in to comment.