Skip to content

Commit

Permalink
Prepare the code for the next version
Browse files Browse the repository at this point in the history
  • Loading branch information
cprudhom committed Sep 9, 2024
1 parent 1990489 commit 2afff0a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 56 deletions.
15 changes: 15 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Choco Solver ChangeLog
This file is dedicated to sum up the new features added and bugs fixed in Choco-solver since the version, 4.0.0.
**Note**: double-space is replaced by "\t" character on release process. Make sure the format is ok.

NEXT MILESTONE
---------------------

### Major features:

### Deprecated API (to be removed in next release):

### Other closed issues and pull requests:
See [milestone 4.10.16](https://github.com/chocoteam/choco-solver/milestone/xx)

#### Contributors to this release:


**Full Changelog**: https://github.com/chocoteam/choco-solver/compare/v4.10.15...v4.10.16

4.10.15 - 09 Sep 2024
-------------------

Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.15</version>
<version>4.10.16-SNAPSHOT</version>
</parent>
<artifactId>examples</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion parsers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.15</version>
<version>4.10.16-SNAPSHOT</version>
</parent>
<artifactId>choco-parsers</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.15</version>
<version>4.10.16-SNAPSHOT</version>
<packaging>pom</packaging>
<name>choco</name>
<url>http://choco-solver.org/</url>
Expand Down
63 changes: 13 additions & 50 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,31 @@ function getVersionToRelease() {
set -ex

VERSION=$(getVersionToRelease)
git checkout master || quit "unable to check master out"
git pull --rebase origin master || quit "unable to pull master"
git checkout -b release-${VERSION} develop || quit "unable to check release-${VERSION} out"

#Establish the version, maven side, misc. side
./scripts/set_version.sh ${VERSION}
mvn license:format -q || quit "unable to update license"
git commit -m "initiate release ${VERSION}" -a || quit "unable to commit last changes"
git push origin master || quit "unable to push on master"

git checkout master || quit "unable to check master out"
git merge --no-ff release-${VERSION} || quit "unable to merge release-${VERSION} into master"
git push origin master || quit "Unable to push the tag ${VERSION}"
# add new tag
#Quit if tag already exists
git ls-remote --exit-code --tags origin v${VERSION} && quit "tag ${VERSION} already exists"
# #Quit if tag already exists
# git ls-remote --exit-code --tags origin v${VERSION} && quit "tag ${VERSION} already exists"
# We assume the tests have been run before, and everything is OK for the release

# add the tag
git tag -a v${VERSION} -m "create tag ${VERSION}" || quit "Unable to tag with ${VERSION}"
git push --tags || quit "Unable to push the tag ${VERSION}"


# Proceed to the deployment
mvn -P ossrhDeploy javadoc:jar source:jar deploy -DskipTests -B -U ||quit "Unable to deploy to master"

## Merge back to develop
git checkout develop || quit "unable to check develop out"
git merge --no-ff release-${VERSION} || quit "unable to merge release-${VERSION} into develop"

#Set the next development version
echo "** Prepare master for the next version **"
./scripts/set_version.sh --next ${VERSION}
Expand All @@ -46,47 +49,7 @@ then
fi

#Push changes on develop, with the tag
git push origin master ||quit "Unable to push to master"
git push origin develop ||quit "Unable to push to master"

## Package the current version
#GH_API="https://api.github.com/repos/chocoteam/choco-solver/"
#GH_UPL="https://uploads.github.com/repos/chocoteam/choco-solver/"
#
#AUTH="Authorization: token ${GH_TOKEN}"
#
## Validate token.
#curl -o /dev/null -i -sH "${AUTH}" "${GH_API}releases" || quit "Error: Invalid repo, token or network issue!";
#
## prepare release comment
#
##find position of release separator in CHANGES.md, only keep the 2nd and 3rd
#temp_file="tmpreadme.json"
#$(touch ${temp_file}) || quit "Unable to create tmp file"
#
## extract release comment
#extractReleaseComment ${VERSION} ${temp_file} || quit "Unable to extract release comment"
#
## create release
#response=$(curl -i -sH "$AUTH" --data @${temp_file} "${GH_API}releases") || quit "Unable to create the release"
#
## get the asset id
#ID=$(echo "$response" | grep -m 1 "id.:"| tr : = | tr -cd '[[:alnum:]]=') || quit "Error: Failed to get release id for tag: ${VERSION}"; echo "$response" | awk 'length($0)<100' >&2
#ID=(${ID//=/ }) || quit "Error: Unable to split id: ${ID}"
#id=${ID[1]} || quit "Error: Unable to get id: ${ID}"
#
## add asset
#curl -i -sH "$AUTH" -H "Content-Type: application/zip" \
# -data-binary @choco-${VERSION}.zip \
# "${GH_UPL}/releases/${id}/assets?name=choco-${VERSION}.zip" \
# || quit "Unable to add asset"
#
#
## create the next milestone
#NEXT=$(echo "${VERSION%.*}.$((${VERSION##*.}+1))") || quit "Unable to get next release number"
#curl -i -sH "$AUTH" --data '{ "title": '\""${NEXT}"\"'}' "${GH_API}milestones"
#
#if [ -d choco-${VERSION} ]; then
# rm -Rf choco-${VERSION} || quit "Unable to remove choco-${VERSION} dir"
#fi
##rm choco-${VERSION}.zip
#rm ${temp_file} || quit "Unable to remove tmp file"
# Delete the release branch
git branch -d release-${VERSION} || quit "Unable to delete release-${VERSION} branch"
4 changes: 2 additions & 2 deletions scripts/set_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ See [milestone '${VERSION%%-SNAPSHOT}'](https://github.com/chocoteam/choco-solve
\
#### Contributors to this release:\
\
**Full Changelog**: https://github.com/chocoteam/choco-solver/compare/v${OVERSION}...v${VERSION%%-SNAPSHOT}
\
**Full Changelog**: https://github.com/chocoteam/choco-solver/compare/v'${OVERSION}'...v'${VERSION%%-SNAPSHOT}'
' CHANGES.md
fi
2 changes: 1 addition & 1 deletion solver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.choco-solver</groupId>
<artifactId>choco</artifactId>
<version>4.10.15</version>
<version>4.10.16-SNAPSHOT</version>
</parent>
<artifactId>choco-solver</artifactId>
<packaging>jar</packaging>
Expand Down

0 comments on commit 2afff0a

Please sign in to comment.