Skip to content

Commit 9fcb24f

Browse files
committed
Release checklist and site release scripts
1 parent bf33e3f commit 9fcb24f

File tree

6 files changed

+128
-3
lines changed

6 files changed

+128
-3
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,16 @@ To avoid field overloading by type during obfuscation, add this to your config:
108108
volatile <fields>;
109109
}
110110
```
111+
112+
## Contributions and releases
113+
114+
All development (both new features and bug fixes) is performed in `develop` branch.
115+
This way `master` sources always contain sources of the most recently released version.
116+
Please send PRs with bug fixes to `develop` branch
117+
Fixes to documentation in markdown files are an exception to this rule. They are updated directly in `master`.
118+
119+
The `develop` branch is pushed to `master` during release.
120+
121+
* Full release procedure checklist is [here](RELEASE.md).
122+
* Steps for contributing new integration modules are explained [here](integration/README.md#Contributing).
123+

RELEASE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# kotlinx.coroutines release checklist
2+
3+
To release new `<version>` of `kotlinx-coroutines`:
4+
5+
1. Checkout `master` branch: <br>
6+
`git checkout master`
7+
8+
2. Retrieve the most recent `master`: <br>
9+
`git pull`
10+
11+
3. Merge `develop` branch unto `master`: <br>
12+
`git merge origin/develop`
13+
14+
4. Search & replace `<old-version>` with `<version>` across the project files. Should replace in:
15+
* [`README.md`](README.md)
16+
* [`coroutines-guide.md`](coroutines-guide.md)
17+
* [`gradle.properties`](gradle.properties)
18+
* [`ui/kotlinx-coroutines-android/example-app/app/build.gradle`](ui/kotlinx-coroutines-android/example-app/app/build.gradle)
19+
* [`ui/kotlinx-coroutines-android/animation-app/gradle.properties`](ui/kotlinx-coroutines-android/animation-app/gradle.properties)
20+
* Make sure to **exclude** `CHANGES.md` from replacements.
21+
22+
5. Write release notes in [`CHANGES.md`](CHANGES.md):
23+
* Use old releases as example of style.
24+
* Write each change on a single line (don't wrap with CR).
25+
* Study commit message from previous release.
26+
27+
6. Commit updated files for new version: <br>
28+
`git commit -a -m "Version <version>"`
29+
30+
7. On [TeamCity integration server](https://teamcity.jetbrains.com/project.html?projectId=KotlinTools_KotlinxCoroutines):
31+
* Wait until "Build" configuration for committed `master` branch passes tests.
32+
* Run "Deploy" configuration with the corresponding new version.
33+
34+
8. In [GitHub](http://github.com/kotlin/kotlinx.coroutines) interface:
35+
* Create new release named as `<version>`.
36+
* Cut & paste lines from [`CHANGES.md`](CHANGES.md) into description.
37+
38+
9. Build and publish documentation for web-site: <br>
39+
`site/deploy.sh <version> push`
40+
41+
0. In [Bintray](http://bintray.com) admin interface:
42+
* Publish artifacts of the new version.
43+
* Wait until newly published version becomes the most recent.
44+
* Sync to Maven Central.

js/example-frontend-js/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ compileKotlin2Js {
2828
}
2929

3030
task bundle(type: NpmTask, dependsOn: [npmInstall, runDceKotlinJs]) {
31+
inputs.files(fileTree("$buildDir/kotlin-js-min/main"))
32+
inputs.files(fileTree(file("src/main/web")))
33+
inputs.file("webpack.config.js")
34+
outputs.dir("$buildDir/dist")
3135
args = ["run", "bundle"]
3236
}
3337

site/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11

2+
def buildDocsDir = "$buildDir/docs"
3+
24
task copyDocs(type: Copy, dependsOn: rootProject.getTasksByName("dokka", true)) {
35
from (rootProject.getTasksByName("dokka", true).collect { "$it.project.buildDir/dokka" }) {
46
include "**/*.md"
57
}
68
from "docs"
7-
into "$buildDir/gh-pages"
9+
into buildDocsDir
810
}
911

1012
task copyExampleFrontendJs(type: Copy, dependsOn: ':example-frontend-js:bundle') {
1113
def srcBuildDir = project(':example-frontend-js').buildDir
1214
from "$srcBuildDir/dist"
13-
into "$buildDir/gh-pages/example-frontend-js"
15+
into "$buildDocsDir/example-frontend-js"
1416
}
1517

1618
task site(type: Exec, description: 'Generate github pages', dependsOn: [copyDocs, copyExampleFrontendJs]) {
17-
workingDir "$buildDir/gh-pages"
19+
inputs.files(fileTree(buildDocsDir))
20+
outputs.dir("$buildDir/dist")
21+
workingDir file(buildDocsDir)
1822
commandLine 'bundle', 'exec', 'jekyll', 'build'
1923
}
2024

site/deploy.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
3+
# Abort on first error
4+
set -e
5+
6+
# Directories
7+
SITE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8+
ROOT_DIR="$SITE_DIR/.."
9+
BUILD_DIR="$SITE_DIR/build"
10+
DIST_DIR="$BUILD_DIR/dist"
11+
PAGES_DIR="$BUILD_DIR/pages"
12+
13+
# Init options
14+
GRADLE_OPT=
15+
PUSH_OPT=
16+
17+
# Set dry run if needed
18+
if [ "$2" == "push" ] ; then
19+
echo "--- Doing LIVE site deployment, so do clean build"
20+
GRADLE_OPT=clean
21+
else
22+
echo "--- Doing dry-run. To commit do 'deploy.sh <version> push'"
23+
PUSH_OPT=--dry-run
24+
fi
25+
26+
# Makes sure that site is built
27+
"$ROOT_DIR/gradlew" $GRADLE_OPT site
28+
29+
# Cleanup dist directory (and ignore errors)
30+
rm -rf "$PAGES_DIR" || true
31+
32+
# Prune worktrees to avoid errors from previous attempts
33+
git --work-tree "$ROOT_DIR" worktree prune
34+
35+
# Create git worktree for gh-pages branch
36+
git --work-tree "$ROOT_DIR" worktree add -B gh-pages "$PAGES_DIR" origin/gh-pages
37+
38+
# Now work in newly created workspace
39+
cd "$PAGES_DIR"
40+
41+
# Remove all the old documentation
42+
git rm -r * > /dev/null
43+
44+
# Copy new documentation from dist
45+
cp -r "$DIST_DIR"/* "$PAGES_DIR"
46+
47+
# Add it all to git
48+
git add *
49+
50+
# Commit docs for the new version
51+
if [ -z "$1" ] ; then
52+
echo "No argument with version supplied -- skipping commit"
53+
else
54+
git commit -m "Version $1 docs"
55+
git push $PUSH_OPT origin gh-pages:gh-pages
56+
fi

site/docs/_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: Library support for kotlin coroutines
44
baseurl: "/kotlinx.coroutines"
55
url: "https://kotlin.github.io"
66

7+
# Dirs
8+
source: .
9+
destination: ../dist
10+
711
# Build settings
812
markdown: kramdown
913
exclude:

0 commit comments

Comments
 (0)