Skip to content

Commit

Permalink
document the process of a release
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Jan 10, 2024
1 parent a7d4184 commit e3cf2f5
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 1 deletion.
127 changes: 127 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -588,3 +588,130 @@ val generateTest: TaskProvider<Task> = 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/(<!-- for main -->\n)\n([\S\s]*?)(\n<!-- for a specific release -->\n)<!--\n([\S\s]*?)-->\n(\n# <img)/$1<!--\n$2-->$3\n$4\n$5/;' \
-pe 's/(---\n❗ You are taking[^-]*?---)/<!$1>/;' \
./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@<script.*src=\"https://unpkg\.com.*</script>@@;" \
-pe "s@(<div class=\"library-name\">[\S\s]+?)Minimalist@\$1<span>Minimalist</span>@;" \
-pe "s@\"((?:\.\./+)*)styles/logo-styles.css\" rel=\"Stylesheet\">@\"../../\${1}styles/logo-styles.css?v=$MNLMST_GH_PAGES_LOGO_CSS_VERSION\" rel=\"Stylesheet\">\n<link href=\"../../\${1}styles/alert.css?v=$MNLMST_GH_PAGES_ALERT_CSS_VERSION\" rel=\"Stylesheet\">\n<script id=\"versions-script\" type=\"text/javascript\" src=\"\../../\${1}scripts/versions.js?v=$MNLMST_GH_PAGES_VERSIONS_JS_VERSION\" data-version=\"$MNLMST_VERSION\" async=\"async\"></script>@g;" \
-pe "s@((?:\.\./+)*)images/logo-icon.svg\"([^>]+)>@../../\${1}images/logo-icon.svg\"\$2>\n<meta name=\"og:image\" content=\"../../\${1}images/logo_social.png\"/>@g;" \
-pe "s@(<a class=\"library-name--link\" href=\"(?:\.\./+)*)index.html\">@\$1../../index.html\" title=\"Back to Overview Code Documentation of Minimalist\">@g;" \
-pe "s@<html@<html lang=\"en\"@g;" \
-pe "s@<head>@<head>\n<meta name=\"keywords\" content=\"Kotlin, junit, junit-jupiter, test, Testing, parameterized tests, minimal test set\">\n<meta name=\"author\" content=\"Tegonal Genossenschaft\">\n<meta name=\"copyright\" content=\"Tegonal Genossenschaft\">@g;" \
-pe "s@<title>([^<]+)</title>@<title>\$1 - Minimalist $MNLMST_VERSION</title>\n<meta name=\"description\" content=\"Code documentation of Minimalist $MNLMST_VERSION: \$1\">@g;" \
-pe "s@(<code class=\"runnablesample[^>]+>)[\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 .*</p>@Released $(LC_ALL=en_GB date '+%b %d, %Y')</p>@;" \
"./$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/(<!-- for main -->\n)<!--\n([\S\s]*?)-->(\n<!-- for a specific release -->)\n([\S\s]*?)\n(\n# <img)/$1\n$2$3\n<!--$4-->\n$5/;' \
-pe 's/<!(---\n❗ You are taking[^-]*?---)>/$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
*/
2 changes: 1 addition & 1 deletion gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import org.jetbrains.dokka.gradle.AbstractDokkaTask

fun AbstractDokkaTask.configurePlugins() {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
footerMessage = "Minimalist &copy; Copyright Tegonal Genossenschaft, Switzerland &lt;info@tegonal.com&gt;"
footerMessage = "Minimalist &copy; Copyright <a href=\"https://tegonal.com\">Tegonal Genossenschaft</a>"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tutteliDokka {
}

tasks.configureEach<AbstractDokkaLeafTask> {
moduleName.set("Minimalist")
dokkaSourceSets.configureEach {
reportUndocumented.set(true)
jdkVersion.set(buildParameters.defaultJdkVersion)
Expand Down

0 comments on commit e3cf2f5

Please sign in to comment.