@@ -71,6 +71,7 @@ def mbeddrVersion = "2020.3+"
71
71
// the name is enough no trailing "." is required, also the plain name from git can
72
72
// be used here. No need to convert "/" the script will take care of that.
73
73
def mbeddrBranch = " "
74
+ def currentBranch = " "
74
75
75
76
76
77
if (mbeddrBranch != null && ! mbeddrBranch. trim(). isEmpty()) {
@@ -85,10 +86,10 @@ if (project.hasProperty('iets3OpenSourceVersion')) {
85
86
version = project. iets3OpenSourceVersion
86
87
} else {
87
88
if (ciBuild) {
88
- String branch = GitBasedVersioning . gitBranch
89
+ currentBranch = GitBasedVersioning . gitBranch
89
90
90
91
def buildNumber = System . env. BUILD_NUMBER . toInteger()
91
- if (branch . startsWith(" maintenance" ) || branch . startsWith(" mps" )) {
92
+ if (currentBranch . startsWith(" maintenance" ) || currentBranch . startsWith(" mps" )) {
92
93
version = " $major . $minor . $buildNumber . ${ GitBasedVersioning.gitShortCommitHash} "
93
94
} else {
94
95
version = GitBasedVersioning . getVersionWithCount(major, minor, buildNumber)
@@ -260,6 +261,21 @@ publishing {
260
261
}
261
262
}
262
263
}
264
+ repositories {
265
+ if (currentBranch == " master" || currentBranch. startsWith(" maintenance" ) || currentBranch. startsWith(" mps" )) {
266
+ maven {
267
+ name = " GitHubPackages"
268
+ url = uri(" https://maven.pkg.github.com/IETS3/iets3.opensource" )
269
+ if (project. hasProperty(" gpr.token" )) {
270
+ credentials {
271
+ username = project. findProperty(" gpr.user" )
272
+ password = project. findProperty(" gpr.token" )
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }
278
+
263
279
publications {
264
280
allScripts(MavenPublication ) {
265
281
groupId ' org.iets3.opensource'
@@ -307,6 +323,7 @@ publishing {
307
323
}
308
324
}
309
325
326
+
310
327
task generateLibrariesXml (type : GenerateLibrariesXml ) {
311
328
dependsOn resolveLanguageLibs
312
329
description " Will read project libraries from projectlibraries.properties and generate libraries.xml in .mps directory. Libraries are loaded in mps during start."
@@ -362,4 +379,4 @@ githubRelease.doFirst {
362
379
}
363
380
}
364
381
365
- githubRelease. dependsOn packageDistroWithDependencies
382
+ githubRelease. dependsOn packageDistroWithDependencies
0 commit comments