Skip to content

Commit 5ce69c1

Browse files
committed
HHH-10042 - Add task to upload dist bundles to BinTray
1 parent 2ec5d93 commit 5ce69c1

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

release/release.gradle

+59-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
55
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
66
*/
7+
plugins {
8+
id "com.jfrog.bintray" version "1.3.1"
9+
}
10+
711
apply plugin: 'base'
812
apply plugin: 'idea'
913
apply plugin: 'distribution'
@@ -223,7 +227,7 @@ task buildBundles(type: Task, dependsOn: [distZip,distTar]) {
223227
description = "Builds all release bundles"
224228
}
225229

226-
task uploadBundles(type: Exec, dependsOn: buildBundles) {
230+
task uploadBundlesSourceForge(type: Exec, dependsOn: buildBundles) {
227231
description = "Uploads release bundles to SourceForge"
228232

229233
final String url = "frs.sourceforge.net:/home/frs/project/hibernate/hibernate-orm/${version}";
@@ -246,6 +250,60 @@ task uploadBundles(type: Exec, dependsOn: buildBundles) {
246250
}
247251
}
248252

253+
String binTrayUser = null
254+
String binTrayApiKey = null
255+
256+
if ( project.hasProperty( "BINTRAY_USER" ) ) {
257+
binTrayUser = project.property( "BINTRAY_USER" ) as String;
258+
}
259+
if ( binTrayUser == null ) {
260+
binTrayUser = System.getProperty( "BINTRAY_USER" );
261+
}
262+
if ( binTrayUser == null ) {
263+
binTrayUser = System.getenv( "BINTRAY_USER" );
264+
}
265+
if ( binTrayUser == null ) {
266+
binTrayUser = 'UNDEFINED'
267+
}
268+
269+
if ( project.hasProperty( "BINTRAY_APIKEY" ) ) {
270+
binTrayApiKey = project.property( "BINTRAY_APIKEY" ) as String;
271+
}
272+
if ( binTrayApiKey == null ) {
273+
binTrayApiKey = System.getProperty( "BINTRAY_APIKEY" );
274+
}
275+
if ( binTrayApiKey == null ) {
276+
binTrayApiKey = System.getenv( "BINTRAY_APIKEY" );
277+
}
278+
if ( binTrayApiKey == null ) {
279+
binTrayApiKey = 'UNDEFINED'
280+
}
281+
282+
283+
bintray {
284+
user = binTrayUser
285+
key = binTrayApiKey
286+
287+
publish = true
288+
289+
filesSpec {
290+
from "$buildDir/distributions"
291+
into '/'
292+
}
293+
294+
pkg {
295+
userOrg = 'hibernate'
296+
repo = 'bundles'
297+
name = 'hibernate-orm'
298+
}
299+
}
300+
301+
bintrayUpload.dependsOn buildBundles
302+
303+
task uploadBundles(dependsOn: [bintrayUpload, uploadBundlesSourceForge]) {
304+
description = 'Performs all release bundle uploads'
305+
}
306+
249307

250308
// Full release related tasks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251309

0 commit comments

Comments
 (0)