From 575a8713c4fb2d9619be0291d5cbe87f50a3ee48 Mon Sep 17 00:00:00 2001 From: Kevin Wooten Date: Sun, 29 Sep 2019 09:32:20 -0700 Subject: [PATCH] Updates to release tasks * Use Gradle 5.4.1 (fixes bug in `gitPublishPush`) * Fix `githubRelease` to pickup artifacts downloaded in same execution * Snapshot docs release without `snapshot/` folder prefix --- .travis.yml | 1 - build.gradle.kts | 4 +++- documentation/build.gradle.kts | 20 ++++++-------------- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a4c7fe2a..73194751c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,6 @@ jobs: - ssh-add .travis/github_deploy_key script: # Workaround for ajoberstar/gradle-git-publish/issues/65, remove when resolved - - ./gradlew --stacktrace -PpostgresVersions=${PGVERSION} documentation:gitPublishPush || true - ./gradlew --stacktrace -PpostgresVersions=${PGVERSION} documentation:gitPublishPush - ./gradlew --stacktrace -PpostgresVersions=${PGVERSION} -PossrhUsername=$SONATYPE_USER -PossrhPassword=$SONATYPE_PASS publish diff --git a/build.gradle.kts b/build.gradle.kts index eed975c77..332f555a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -57,6 +57,7 @@ tasks { ) val downloadArtifacts = register("downloadArtifacts") { + outputs.files(downloadTasks.flatMap { it.get().outputFiles }) dependsOn(downloadTasks) } @@ -77,7 +78,7 @@ tasks { ## [User Guide](https://impossibl.github.io/pgjdbc-ng/docs/$version/user-guide) """.trimIndent().trim() ) - releaseAssets.from(file("$buildDir/artifacts/").listFiles()) + releaseAssets.from(downloadArtifacts) } } @@ -95,6 +96,7 @@ fun centralDownload(group: String, artifact: String, classifier: String? = null) } return tasks.register("downloadCentral" + "$group-$artifact-${classifier ?: ""}") { + outputFiles.add(file(dest)) src("$base?r=$repo&g=$group&a=$artifact$queryClassifier&v=$version") dest(dest) } diff --git a/documentation/build.gradle.kts b/documentation/build.gradle.kts index ebac783c1..026e328a6 100644 --- a/documentation/build.gradle.kts +++ b/documentation/build.gradle.kts @@ -115,21 +115,13 @@ tasks { branch.set("gh-pages") contents { - if (isSnapshot) { - from("$buildDir/docs/html5") { - into("docs/snapshot/$version") - } - from ("$buildDir/javadoc") { - into("docs/snapshot/$version/javadoc") - } + from("$buildDir/docs/html5") { + into("docs/$version") } - else { - from("$buildDir/docs/html5") { - into("docs/$version") - } - from ("$buildDir/javadoc") { - into("docs/$version/javadoc") - } + from ("$buildDir/javadoc") { + into("docs/$version/javadoc") + } + if (!isSnapshot) { from("$buildDir/docs/html5") { into("docs/current") } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1c3563a6e..70e4bd366 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip