@@ -88,8 +88,12 @@ task initializeVariables {
8888 }
8989
9090 gradle. taskGraph. whenReady { graph ->
91- if (graph. hasTask(" :${ packageName} -ballerina:build" ) || graph. hasTask(" :${ packageName} -ballerina:publish" )) {
91+ if (graph. hasTask(" :${ packageName} -ballerina:build" ) ||
92+ graph. hasTask(" :${ packageName} -ballerina:publish" ) ||
93+ graph. hasTask(" :${ packageName} -ballerina:publishToMavenLocal" )) {
9294 ballerinaTest. enabled = false
95+ } else {
96+ ballerinaTest. enabled = true
9397 }
9498
9599 if (graph. hasTask(" :${ packageName} -ballerina:test" )) {
@@ -180,6 +184,9 @@ task ballerinaBuild {
180184
181185task ballerinaPublish {
182186 doLast {
187+ if (project. version. endsWith(' -SNAPSHOT' )) {
188+ return
189+ }
183190 if (ballerinaCentralAccessToken != null ) {
184191 println (" Publishing to the ballerina central..." )
185192 exec {
@@ -188,9 +195,11 @@ task ballerinaPublish {
188195 if (Os . isFamily(Os . FAMILY_WINDOWS )) {
189196 commandLine ' cmd' , ' /c' , " $distributionBinPath /bal.bat push ${ packageName} && exit %%ERRORLEVEL%%"
190197 } else {
191- commandLine ' sh' , ' -c' , " $distributionBinPath /bal push ${ packageName } "
198+ commandLine ' sh' , ' -c' , " $distributionBinPath /bal push"
192199 }
193200 }
201+ } else {
202+ throw new InvalidUserDataException (" Central Access Token is not present" )
194203 }
195204 }
196205}
@@ -228,4 +237,8 @@ updateTomlVersions.dependsOn unpackJballerinaTools
228237build. dependsOn ballerinaBuild
229238
230239ballerinaPublish. dependsOn ballerinaBuild
240+ ballerinaPublish. finalizedBy revertTomlFile
241+ ballerinaPublish. dependsOn initializeVariables
242+ ballerinaPublish. dependsOn updateTomlVersions
243+ ballerinaPublish. dependsOn " :${ packageName} -native:build"
231244publish. dependsOn ballerinaPublish
0 commit comments