diff --git a/build.gradle.kts b/build.gradle.kts index 895b767..2f15c1e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -588,3 +588,130 @@ val generateTest: TaskProvider = tasks.register("generateTest") { } } generationTestFolder.builtBy(generateTest) + +/* +Release & deploy a commit +-------------------------------- + +1. update main: + + +export MNLMST_PREVIOUS_VERSION=0.9.0 +export MNLMST_VERSION=1.0.0 +find ./ -name "*.md" | xargs perl -0777 -i \ + -pe "s@$MNLMST_PREVIOUS_VERSION@$MNLMST_VERSION@g;" \ + -pe "s@tree/main@tree/v$MNLMST_VERSION@g;" \ + -pe "s@latest#/doc@$MNLMST_VERSION/doc@g;" +perl -0777 -i \ + -pe "s@$MNLMST_PREVIOUS_VERSION@$MNLMST_VERSION@g;" \ + -pe "s/rootProject.version = \"${MNLMST_VERSION}-SNAPSHOT\"/rootProject.version = \"$MNLMST_VERSION\"/;" \ + ./build.gradle.kts +perl -0777 -i \ + -pe 's/(\n)\n([\S\s]*?)(\n\n)\n(\n# $3\n$4\n$5/;' \ + -pe 's/(---\n❗ You are taking[^-]*?---)//;' \ + ./README.md +git commit -a -m "v$MNLMST_VERSION" + +check changes (CONTRIBUTING.md, difference.md, build.gradle.kts, README.md) +git push + + +2. prepare release on github + a) git tag "v$MNLMST_VERSION" + b) git push origin "v$MNLMST_VERSION" + c) Log in to github and create draft for the release + +The tag is required for dokka in order that the externalLinkDocumentation and source-mapping works + +3. update github pages: +Assumes you have a minimalist-gh-pages folder on the same level as minimalist where the gh-pages branch is checked out + +Either use the following commands or the manual steps below (assuming MNLMST_PREVIOUS_VERSION and MNLMST_VERSION +is already set from commands above) + +Increment MNLMST_GH_PAGES_VERSIONS_JS_VERSION_NEXT + +export MNLMST_GH_PAGES_LOGO_CSS_VERSION="1.3" +export MNLMST_GH_PAGES_ALERT_CSS_VERSION="1.1" +export MNLMST_GH_PAGES_VERSIONS_JS_VERSION="1.2.0" +export MNLMST_GH_PAGES_VERSIONS_JS_VERSION_NEXT="1.3.0" + +gr dokkaHtml + +cd ../minimalist-gh-pages +git add . && git commit -m "dokka generation for v$MNLMST_VERSION" + +perl -0777 -i \ + -pe "s@$MNLMST_PREVIOUS_VERSION@$MNLMST_VERSION@g;" \ + ./index.html +perl -0777 -i \ + -pe "s@$MNLMST_PREVIOUS_VERSION@$MNLMST_VERSION@g;" \ + ./latest/index.html +perl -0777 -i \ + -pe "s/(\s+)\"$MNLMST_PREVIOUS_VERSION\",/\$1\"$MNLMST_VERSION\",\$1\"$MNLMST_PREVIOUS_VERSION\",/;" \ + ./scripts/versions.js + + +find "./$MNLMST_VERSION" -name "*.html" | xargs perl -0777 -i \ + -pe "s@@@;" \ + -pe "s@(
[\S\s]+?)Minimalist@\$1Minimalist@;" \ + -pe "s@\"((?:\.\./+)*)styles/logo-styles.css\" rel=\"Stylesheet\">@\"../../\${1}styles/logo-styles.css?v=$MNLMST_GH_PAGES_LOGO_CSS_VERSION\" rel=\"Stylesheet\">\n\n@g;" \ + -pe "s@((?:\.\./+)*)images/logo-icon.svg\"([^>]+)>@../../\${1}images/logo-icon.svg\"\$2>\n@g;" \ + -pe "s@(@\$1../../index.html\" title=\"Back to Overview Code Documentation of Minimalist\">@g;" \ + -pe "s@@\n\n\n@g;" \ + -pe "s@([^<]+)@\$1 - Minimalist $MNLMST_VERSION\n@g;" \ + -pe "s@(]+>)[\S\s]+?//sampleStart[\n\s]*([\S\s]+?)\s+//sampleEnd[\n\s]*\}@\${1}\${2}@g;" + +find "./" -name "*.html" | xargs perl -0777 -i \ + -pe "s@(scripts/versions\.js\?v\=)$MNLMST_GH_PAGES_VERSIONS_JS_VERSION@\${1}$MNLMST_GH_PAGES_VERSIONS_JS_VERSION_NEXT@g;" + +cp "./$MNLMST_PREVIOUS_VERSION/index.html" "./$MNLMST_VERSION/index.html" +perl -0777 -i \ + -pe "s/$MNLMST_PREVIOUS_VERSION/$MNLMST_VERSION/g;" \ + -pe "s@Released .*

@Released $(LC_ALL=en_GB date '+%b %d, %Y')

@;" \ + "./$MNLMST_VERSION/index.html" +git add . && git commit -m "v$MNLMST_VERSION" + +check changes +git push + +cd ../minimalist + +3. deploy to maven central: +(assumes you have an alias named gr pointing to ./gradlew) + a) java -version 2>&1 | grep "version \"11" && CI=true gr clean publishToSonatype + b) Log into https://oss.sonatype.org/#stagingRepositories + c) check if staging repo is ok + d) close repo + e) release repo + +4. publish release on github + 1) Log in to github and publish draft + +Prepare next dev cycle +----------------------- + 1. update main: + + +export MNLMST_VERSION=1.1.0 +export MNLMST_NEXT_VERSION=1.2.0 +find ./ -name "*.md" | xargs perl -0777 -i \ + -pe "s@tree/v$MNLMST_VERSION@tree/main@g;" \ + -pe "s@$MNLMST_VERSION/doc@latest#/doc@g;" \ + -pe "s/add \\\`\@since $MNLMST_VERSION\\\` \(adapt to current/add \\\`\@since $MNLMST_NEXT_VERSION\\\` \(adapt to current/g;" +perl -0777 -i \ + -pe "s/rootProject.version = \"$MNLMST_VERSION\"/rootProject.version = \"${MNLMST_NEXT_VERSION}-SNAPSHOT\"/;" \ + -pe "s/MNLMST_VERSION=$MNLMST_VERSION/MNLMST_VERSION=$MNLMST_NEXT_VERSION/;" \ + ./build.gradle.kts +perl -0777 -i \ + -pe 's/(\n)(\n)\n([\S\s]*?)\n(\n# \n$5/;' \ + -pe 's//$1/;' \ + -pe "s@(latest version: \[README of v$MNLMST_VERSION\].*tree/)main/@\$1v$MNLMST_VERSION/@;" \ + ./README.md +git commit -a -m "prepare dev cycle of $MNLMST_NEXT_VERSION" + +check changes +git push + +*/ diff --git a/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt b/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt index 46f9796..d104cda 100644 --- a/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt +++ b/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt @@ -4,6 +4,6 @@ import org.jetbrains.dokka.gradle.AbstractDokkaTask fun AbstractDokkaTask.configurePlugins() { pluginConfiguration { - footerMessage = "Minimalist © Copyright Tegonal Genossenschaft, Switzerland <info@tegonal.com>" + footerMessage = "Minimalist © Copyright
Tegonal Genossenschaft" } } diff --git a/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts b/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts index 83b297a..02b4bb9 100644 --- a/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts +++ b/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts @@ -14,6 +14,7 @@ tutteliDokka { } tasks.configureEach { + moduleName.set("Minimalist") dokkaSourceSets.configureEach { reportUndocumented.set(true) jdkVersion.set(buildParameters.defaultJdkVersion)