-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): create a dedicated Maven publish script for releasing (#42)
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Publish Maven artifacts | ||
|
||
set -Eeuo pipefail | ||
trap 'echo "Error encountered while executing the script." >&2' ERR | ||
|
||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P); readonly SCRIPT_DIR | ||
ROOT_REPOSITORY_DIR="$(realpath "${SCRIPT_DIR}/../..")"; readonly ROOT_REPOSITORY_DIR | ||
|
||
readonly NEW_VERSION="$1" | ||
readonly DEV_VERSION='0.0.1-DEV-SNAPSHOT' | ||
|
||
main() { | ||
echo "Publishing version ${NEW_VERSION}..." | ||
|
||
cd "${ROOT_REPOSITORY_DIR}" | ||
|
||
mvn versions:set -DnewVersion="${NEW_VERSION}" --batch-mode --errors | ||
mvn deploy --activate-profiles release -Dstyle.color=always \ | ||
--batch-mode --errors --strict-checksums --update-snapshots | ||
|
||
echo "The new version ${NEW_VERSION} has been published successfully!" | ||
|
||
echo 'Putting back the DEV version...' | ||
mvn versions:set -DnewVersion="${DEV_VERSION}" --batch-mode --errors | ||
} | ||
|
||
main |