File tree Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env -S bash -e
2
2
3
+ EXTRA_JRELEASER_ADDITIONAL_OPTIONS=' '
4
+
5
+ while getopts ' d:' opt; do
6
+ case " $opt " in
7
+ d)
8
+ # Dry run
9
+ echo " DRY RUN: will not push/deploy/publish anything."
10
+ EXTRA_JRELEASER_ADDITIONAL_OPTIONS=' --dry-run'
11
+ ;;
12
+ \? )
13
+ usage
14
+ exit 1
15
+ ;;
16
+ esac
17
+ done
18
+
3
19
SCRIPTS_DIR=" $( readlink -f ${BASH_SOURCE[0]} | xargs dirname) "
4
20
5
21
PROJECT=$1
48
64
49
65
if [ -f " ./jreleaser.yml" ]; then
50
66
# JReleaser-based build
51
- EXTRA_JRELEASER_ADDITIONAL_OPTIONS=' '
52
- if [ " $PUSH_CHANGES " == ' false' ] ; then
53
- EXTRA_JRELEASER_ADDITIONAL_OPTIONS=' --dry-run'
54
- fi
55
-
56
67
export JRELEASER_GPG_HOMEDIR=" $RELEASE_GPG_HOMEDIR "
57
- curl https://jreleaser.org/setup.sh -sSfL | sh
58
- jreleaser full-release -Djreleaser.project.version=" $RELEASE_VERSION " $EXTRA_JRELEASER_ADDITIONAL_OPTIONS
68
+ # Get the jreleaser downloader
69
+ curl -sL https://git.io/get-jreleaser > get_jreleaser.java
70
+ # Download JReleaser with version = <version>
71
+ # Change <version> to a tagged JReleaser release
72
+ # or leave it out to pull `latest`.
73
+ java get_jreleaser.java
74
+ # Let's check we've got the right version
75
+ java -jar jreleaser-cli.jar --version
76
+ # Execute a JReleaser command such as 'full-release'
77
+ java -jar jreleaser-cli.jar -Djreleaser.project.version=" $RELEASE_VERSION " $EXTRA_JRELEASER_ADDITIONAL_OPTIONS
59
78
fi
60
79
fi
61
80
Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ if [ -z "$DEVELOPMENT_VERSION" ]; then
73
73
echo " ERROR: Development version not supplied"
74
74
exit 1
75
75
fi
76
+ if [ " $PUSH_CHANGES " != " true" ]; then
77
+ ADDITIONAL_OPTIONS=" -d"
78
+ fi
76
79
77
80
RELEASE_VERSION_FAMILY=$( echo " $RELEASE_VERSION " | sed -E ' s/^([0-9]+\.[0-9]+).*/\1/' )
78
81
@@ -90,7 +93,7 @@ if [ "$PROJECT" == "orm" ] || [ "$PROJECT" == "reactive" ]; then
90
93
-PreleaseVersion=$RELEASE_VERSION -PdevelopmentVersion=$DEVELOPMENT_VERSION \
91
94
-PdocPublishBranch=production -PgitRemote=origin -PgitBranch=$BRANCH
92
95
else
93
- bash -xe " $SCRIPTS_DIR /deploy.sh" " $PROJECT "
96
+ bash -xe " $SCRIPTS_DIR /deploy.sh" $ADDITIONAL_OPTIONS " $PROJECT "
94
97
if [[ " $PROJECT " != " tools" && " $PROJECT " != " hcann" && ! $PROJECT =~ ^infra-.+ ]]; then
95
98
exec_or_dry_run bash -xe " $SCRIPTS_DIR /upload-distribution.sh" " $PROJECT " " $RELEASE_VERSION "
96
99
exec_or_dry_run bash -xe " $SCRIPTS_DIR /upload-documentation.sh" " $PROJECT " " $RELEASE_VERSION " " $RELEASE_VERSION_FAMILY "
You can’t perform that action at this time.
0 commit comments