@@ -15,6 +15,13 @@ image: objectboxio/buildenv-core:2024-07-11 # With JDK 17
15
15
# - ORG_GRADLE_PROJECT_signingPassword
16
16
17
17
variables :
18
+ OBX_RELEASE :
19
+ value : " false"
20
+ options : [ "false", "true" ]
21
+ description : " Turns on the release flag in the Gradle root build script, which triggers building and publishing a
22
+ release of Java libraries to the internal GitLab repository and Maven Central.
23
+ Consult the release checklist before turning this on."
24
+
18
25
# Disable the Gradle daemon. Gradle may run in a Docker container with a shared
19
26
# Docker volume containing GRADLE_USER_HOME. If the container is stopped after a job
20
27
# Gradle daemons may get killed, preventing proper clean-up of lock files in GRADLE_USER_HOME.
@@ -173,16 +180,16 @@ publish-maven-internal:
173
180
script :
174
181
- ./gradlew $GITLAB_REPO_ARGS $GITLAB_PUBLISH_ARGS $VERSION_ARGS publishMavenJavaPublicationToGitLabRepository
175
182
176
- # Publish Maven artifacts to public Maven repo at Central
183
+ # Publish Maven artifacts to public Maven Central repo
177
184
publish-maven-central :
178
185
stage : publish-maven-central
179
186
tags :
180
187
- docker
181
188
- linux
182
189
- x64
183
190
rules :
184
- # Only on publish branch , only if no previous stages failed
185
- - if : $CI_COMMIT_BRANCH == "publish "
191
+ # Only if release mode is on , only if no previous stages failed
192
+ - if : $OBX_RELEASE == "true "
186
193
when : on_success
187
194
before_script :
188
195
- ci/send-to-gchat.sh "$GOOGLE_CHAT_WEBHOOK_JAVA_CI" --thread $CI_COMMIT_SHA "*Releasing Java library:* job $CI_JOB_NAME from branch $CI_COMMIT_BRANCH ($CI_COMMIT_SHORT_SHA)..."
@@ -202,8 +209,8 @@ package-api-docs:
202
209
- linux
203
210
- x64
204
211
rules :
205
- # Only on publish branch , only if no previous stages failed
206
- - if : $CI_COMMIT_BRANCH == "publish "
212
+ # Only if release mode is on , only if no previous stages failed
213
+ - if : $OBX_RELEASE == "true "
207
214
when : on_success
208
215
script :
209
216
- ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS :objectbox-java:packageJavadocForWeb
@@ -217,6 +224,9 @@ package-api-docs:
217
224
trigger-plugin :
218
225
stage : triggers
219
226
rules :
227
+ # Not when publishing a release
228
+ - if : $OBX_RELEASE == "true"
229
+ when : never
220
230
# Do not trigger publishing of plugin
221
231
- if : $CI_COMMIT_BRANCH == "publish"
222
232
when : never
0 commit comments