diff --git a/DEV_NOTES.md b/DEV_NOTES.md new file mode 100644 index 0000000..d711430 --- /dev/null +++ b/DEV_NOTES.md @@ -0,0 +1,24 @@ +# DEV Notes + +## How to release a new version + +Before create a new version please update the CHANGELOG.md. + +```bash +bash dev/scripts/release.sh 1.0.0 +``` + +This will trigger a CI/CD pipeline where it will: + +* Build & Packaging the JDK library and CLI +* Build & deploy a docker image +* Create a draft GitHub release + +After the pipeline ends please do the following step: + +* Update the draft GitHub release +* Run the prepare next version script + +```commandline +bash dev/scripts/prepare-next-release.sh 1.1.0 +``` diff --git a/dev/scripts/prepare-next-version.sh b/dev/scripts/prepare-next-version.sh new file mode 100755 index 0000000..e1d4f9a --- /dev/null +++ b/dev/scripts/prepare-next-version.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# Version +NEXT_VERSION=$1 + +function syntax { + echo "Syntax: $1 NEXT_VERSION" + echo "Example: $1 2.3.0" +} + +if [[ -z "$NEXT_VERSION" ]]; then + syntax "$0" + exit 1 +fi + +cat << EOF +################################ +# Prepare for next version +################################ +EOF + +# Updating with next version SNAPSHOT +mvn versions:set versions:commit -DnewVersion="$NEXT_VERSION-SNAPSHOT" + +# Commit Maven version update +git add -u +git commit -m "Setting version $NEXT_VERSION-SNAPSHOT" + +# Push commits +git push diff --git a/dev/scripts/release.sh b/dev/scripts/release.sh new file mode 100755 index 0000000..f7aa591 --- /dev/null +++ b/dev/scripts/release.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Version +RELEASE_VERSION=$1 + +function syntax { + echo "Syntax: $1 RELEASE_VERSION" + echo "Example: $1 2.2.0" +} + +if [[ -z "$RELEASE_VERSION" ]]; then + syntax "$0" + exit 1 +fi + +cat << EOF +################################ +# Release version +################################ +EOF + +RELEASE_TAG="v$RELEASE_VERSION" + +# Ensure all classes have license header +mvn license:format + +# Updating RODA Maven modules +mvn versions:set versions:commit -DnewVersion="$RELEASE_VERSION" + +# Commit Maven version update +git add -u +git commit -m "Setting version $RELEASE_VERSION" + +# Create tag +git tag -a "$RELEASE_TAG" -m "Version $RELEASE_VERSION" + +# Push tag +git push origin "$RELEASE_TAG"