File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ buildscript {
18
18
val objectboxVersionRelease =
19
19
true // set to true for releasing to ignore versionPostFix to avoid e.g. "-dev" versions
20
20
21
+ // To avoid duplicate release artifacts on the internal repository,
22
+ // prevent uploading from branches other than publish, and main (for which uploading is turned off).
23
+ val isCI = System .getenv(" CI" ) == " true"
24
+ val branchOrTag = System .getenv(" CI_COMMIT_REF_NAME" )
25
+ if (isCI && objectboxVersionRelease && ! (" publish" == branchOrTag || " main" == branchOrTag)) {
26
+ throw GradleException (" objectboxVersionRelease = true is only allowed on branch publish or main" )
27
+ }
28
+
21
29
// version post fix: "-<value>" or "" if not defined; e.g. used by CI to pass in branch name
22
30
val versionPostFixValue = project.findProperty(" versionPostFix" )
23
31
val versionPostFix = if (versionPostFixValue != null ) " -$versionPostFixValue " else " "
You can’t perform that action at this time.
0 commit comments