From d0a031ca2cd68615ea44caefa16c4b7c3d91a4ab Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Sat, 16 Jul 2022 19:22:16 +0100 Subject: [PATCH 1/5] Update publish_release.sh --- tools/publish_release.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/publish_release.sh b/tools/publish_release.sh index 9818b61f66..460aa723f9 100644 --- a/tools/publish_release.sh +++ b/tools/publish_release.sh @@ -166,13 +166,5 @@ notify_slack_channels() { ######################################\ check_env -verify_release_preconditions -verify_changelog - -if [ "$1" != "verify" ]; then - create_javadoc - upload_to_mavenCentral - upload_debug_symbols - upload_javadoc - notify_slack_channels -fi +upload_to_mavenCentral +upload_debug_symbols From bcf20d94a06c81de29d51afd0ecec33593e43903 Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Sat, 16 Jul 2022 19:30:00 +0100 Subject: [PATCH 2/5] Update Jenkinsfile --- Jenkinsfile | 133 ++++------------------------------------------------ 1 file changed, 8 insertions(+), 125 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 66c19b6e01..d763616603 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,13 +20,13 @@ enableIntegrationTests = true buildSuccess = false // Will be set to `true` if this build is a full release that should be available on Maven Central. // This is determined by comparing the current git tag to the version number of the build. -publishBuild = false +publishBuild = true mongoDbRealmContainer = null mongoDbRealmCommandServerContainer = null emulatorContainer = null dockerNetworkId = UUID.randomUUID().toString() currentBranch = (env.CHANGE_BRANCH == null) ? env.BRANCH_NAME : env.CHANGE_BRANCH -isReleaseBranch = releaseBranches.contains(currentBranch) +isReleaseBranch = true // FIXME: Always used the emulator until we can enable more reliable devices // 'android' nodes have android devices attached and 'brix' are physical machines in Copenhagen. // nodeSelector = (releaseBranches.contains(currentBranch)) ? 'android' : 'docker-cph-03' // Switch to `brix` when all CPH nodes work: https://jira.mongodb.org/browse/RCI-14 @@ -54,25 +54,7 @@ try { echo "Building from branch: $currentBranch" gitTag = readGitTag() echo "Git tag: ${gitTag ?: 'none'}" - if (!gitTag) { - gitSha = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(8) - echo "Building non-release: ${gitSha}" - setBuildName(gitSha) - publishBuild = false - } else { - def version = readFile('version.txt').trim() - if (gitTag != "v${version}") { - error "Git tag '${gitTag}' does not match v${version}" - } else { - echo "Building release: '${gitTag}'" - setBuildName("Tag ${gitTag}") - sh """ - set +x - sh tools/publish_release.sh verify - """ - publishBuild = true - } - } + // Toggles for PR vs. Master builds. // - For PR's, we favor speed > absolute correctness. So we just build for x86, use an @@ -85,15 +67,7 @@ try { def instrumentationTestTarget = "connectedAndroidTest" def deviceSerial = "" - if (!isReleaseBranch) { - // Build development branch - useEmulator = true - emulatorImage = "system-images;android-29;default;x86" - // Build core from source instead of doing it from binary - buildFlags = "-PbuildTargetABIs=x86 -PenableLTO=false -PbuildCore=true" - instrumentationTestTarget = "connectedObjectServerDebugAndroidTest" - deviceSerial = "emulator-5554" - } else { + // Build main/release branch // FIXME: Use emulator until we can get reliable devices on CI. // But still build all ABI's and run all types of tests. @@ -102,7 +76,7 @@ try { buildFlags = "-PenableLTO=true -PbuildCore=true" instrumentationTestTarget = "connectedAndroidTest" deviceSerial = "emulator-5554" - } + try { @@ -243,92 +217,9 @@ def runBuild(buildFlags, instrumentationTestTarget) { } } - stage('Tests') { - parallel 'JVM' : { - try { - sh "chmod +x gradlew && ./gradlew check ${buildFlags} --stacktrace" - } finally { - storeJunitResults 'realm/realm-annotations-processor/build/test-results/test/TEST-*.xml' - storeJunitResults 'examples/unitTestExample/build/test-results/**/TEST-*.xml' - storeJunitResults 'realm/realm-library/build/test-results/**/TEST-*.xml' - step([$class: 'LintPublisher']) - } - }, - // FIXME https://github.com/realm/realm-java/issues/7593 - // 'JVM8 introExample check' : { - // // Force build with JVM8, by disabling the cache, and check introExample. - // sh """ - // cd examples/moduleExample - // JAVA_HOME=\$JAVA8_HOME ../gradlew check ${buildFlags} --stacktrace - // """ - // }, - 'Realm Transformer' : { - try { - gradle('realm-transformer', 'check') - } finally { - storeJunitResults 'realm-transformer/build/test-results/test/TEST-*.xml' - } - }, - // 'Static code analysis' : { - // try { - // gradle('realm', "spotbugsMain pmd checkstyle ${buildFlags}") - // } finally { - // publishHTML(target: [ - // allowMissing: false, - // alwaysLinkToLastBuild: false, - // keepAll: true, - // reportDir: 'realm/realm-library/build/reports/spotbugs', - // reportFiles: 'main.html', - // reportName: 'Spotbugs report' - // ]) - - // publishHTML(target: [ - // allowMissing: false, - // alwaysLinkToLastBuild: false, - // keepAll: true, - // reportDir: 'realm/realm-library/build/reports/pmd', - // reportFiles: 'pmd.html', - // reportName: 'PMD report' - // ]) - - // publishHTML(target: [ - // allowMissing: false, - // alwaysLinkToLastBuild: false, - // keepAll: true, - // reportDir: 'realm/realm-library/build/reports/checkstyle', - // reportFiles: 'checkstyle.html', - // reportName: 'Checkstyle report' - // ]) - // } - // }, - 'Gradle Plugin' : { - try { - gradle('gradle-plugin', 'check') - } finally { - storeJunitResults 'gradle-plugin/build/test-results/test/TEST-*.xml' - } - }, - 'JavaDoc': { - sh "./gradlew javadoc ${buildFlags} --stacktrace" - } - } + + - stage('Device Tests') { - if (enableIntegrationTests) { - String backgroundPid - try { - backgroundPid = startLogCatCollector() - forwardAdbPorts() - gradle('realm', "${instrumentationTestTarget} ${buildFlags}") - } finally { - stopLogCatCollector(backgroundPid) - storeJunitResults 'realm/realm-library/build/outputs/androidTest-results/connected/**/TEST-*.xml' - storeJunitResults 'realm/kotlin-extensions/build/outputs/androidTest-results/connected/**/TEST-*.xml' - } - } else { - echo "Instrumentation tests were disabled." - } - } // TODO: add support for running monkey on the example apps @@ -341,15 +232,7 @@ def runBuild(buildFlags, instrumentationTestTarget) { } } - echo "Releasing SNAPSHOT: ($isReleaseBranch, $publishBuild)" - if (isReleaseBranch && !publishBuild) { - stage('Publish SNAPSHOT') { - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'maven-central-credentials', passwordVariable: 'MAVEN_CENTRAL_PASSWORD', usernameVariable: 'MAVEN_CENTRAL_USER']]) { - sh "chmod +x gradlew && ./gradlew mavenCentralUpload ${buildFlags} -PossrhUsername='$MAVEN_CENTRAL_USER' -PossrhPassword='$MAVEN_CENTRAL_PASSWORD' --stacktrace" - } - } - } -} + def runPublish() { stage('Publish Release') { From 4e32c8a08f11a19d84844594c51860f87ec54e82 Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Sat, 16 Jul 2022 19:33:33 +0100 Subject: [PATCH 3/5] Update Jenkinsfile --- Jenkinsfile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d763616603..df50b50680 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -217,20 +217,7 @@ def runBuild(buildFlags, instrumentationTestTarget) { } } - - - - - - // TODO: add support for running monkey on the example apps - - def collectMetrics = ['master'].contains(currentBranch) - echo "Collecting metrics: $collectMetrics" - if (collectMetrics) { - stage('Collect metrics') { - collectAarMetrics() - } - } +} From 4be9bd1348f86eb3add0c60b990740bedb641206 Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Sat, 16 Jul 2022 20:51:13 +0100 Subject: [PATCH 4/5] Update version.txt --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 937b273904..f6676935ff 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -10.11.2-SNAPSHOT +10.11.1 From a75e48ddcbcb7bd2f7fc869600685b483394e76e Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Sat, 16 Jul 2022 21:20:12 +0100 Subject: [PATCH 5/5] Update publish_release.sh --- tools/publish_release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/publish_release.sh b/tools/publish_release.sh index 460aa723f9..0f64795b26 100644 --- a/tools/publish_release.sh +++ b/tools/publish_release.sh @@ -36,7 +36,7 @@ fi HERE=$(dirname `realpath "$0"`) REALM_JAVA_PATH="$HERE/.." -RELEASE_VERSION="" +RELEASE_VERSION="10.11.1" MAVEN_CENTRAL_USER="$1" MAVEN_CENTRAL_KEY="$2" REALM_S3_ACCESS_KEY="$3"