diff --git a/buildSrc/src/main/kotlin/website.gradle.kts b/buildSrc/src/main/kotlin/website.gradle.kts index 0678ce18..11b5c400 100644 --- a/buildSrc/src/main/kotlin/website.gradle.kts +++ b/buildSrc/src/main/kotlin/website.gradle.kts @@ -288,8 +288,8 @@ val updateWebsiteChangelog by tasks.registering(Copy::class) { val versionDocs by tasks.registering(Exec::class) { - description = - "creates a new version snapshot of website docs, using the current version defined in gradle.properties" + description = "creates a new version snapshot of website docs, " + + "using the current version defined in gradle.properties" group = "website" val existingVersions = with(File("$rootDir/website/versions.json")) { @@ -306,6 +306,8 @@ val versionDocs by tasks.registering(Exec::class) { workingDir("$rootDir/website") commandLine("yarn", "run", "docusaurus", "docs:version", version) + + dependsOn(yarnInstall) } val startSite by tasks.registering(Exec::class) { diff --git a/release.sh b/release.sh index 1e5ef9c0..5bf6cbd0 100644 --- a/release.sh +++ b/release.sh @@ -1,20 +1,49 @@ #!/bin/bash +# +# Copyright (C) 2021-2022 Rick Busarow +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# exit when any command fails +set -e + +# keep track of the last executed command +# shellcheck disable=SC2154 +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +# echo an error message before exiting +# shellcheck disable=SC2154 +trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT + +./gradlew clean # Publish Maven release -./gradlew publish --no-daemon --no-parallel +./gradlew publish --no-daemon --no-parallel --no-configuration-cache # Close Maven release -./gradlew closeAndReleaseRepository --no-daemon --no-parallel +./gradlew closeAndReleaseRepository --no-daemon --no-parallel --no-configuration-cache # Publish to Gradle Plugin Portal -./gradlew publishPlugins +./gradlew publishPlugins --no-configuration-cache # Create new website docs version ./gradlew versionDocs # Set all versions in the root README to the new version -./gradlew updateProjectReadmeVersionRefs +./gradlew updateProjectReadmeVersionRefs --no-configuration-cache + +# Copy the CHANGELOG from project root to the website dir and update its formatting +./gradlew updateWebsiteChangelog echo echo ' ___ _ _ ___ ___ ___ ___ ___'