From 5af671e44eb009da90e47abe042a3e711d0f57d0 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Tue, 25 Jul 2023 19:33:17 +0200 Subject: [PATCH 1/3] Trying to upgrade libc --- jitpack.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jitpack.yml b/jitpack.yml index 87055334f5..5121af68cf 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -4,6 +4,11 @@ before_install: - mkdir -p ~/go - wget -q https://go.dev/dl/go1.20.4.linux-amd64.tar.gz && tar -C ~ -xzf go1.20.4.linux-amd64.tar.gz - ls -l ~/go + - uname -a + - cat /etc/*-release + - strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC + - apt update -y + - apt upgrade -y libc6 install: - export PATH="$PATH:$HOME/go/bin" - cp gradle.properties.example gradle.properties From 2de317df6a19883a8f31da4bed6d25191b36992d Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Tue, 25 Jul 2023 19:53:20 +0200 Subject: [PATCH 2/3] Trying to fix Maven Central publish --- .github/workflows/build.yml | 4 ++-- build.gradle.kts | 15 +++++++++++++++ buildSrc/build.gradle.kts | 1 + .../kotlin/cpg.common-conventions.gradle.kts | 18 ++---------------- cpg-language-typescript/build.gradle.kts | 2 +- .../src/main/nodejs/package-lock.json | 8 ++++---- .../src/main/nodejs/package.json | 2 +- gradle/libs.versions.toml | 2 ++ 8 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2daaf5ac04..1e7bda4fd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,11 +147,11 @@ jobs: with: name: reports path: reports.zip - - name: Publish + - name: Publish to Maven Central if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'beta') && !contains(github.ref, 'alpha') run: | export ORG_GRADLE_PROJECT_signingKey=`echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d` - ./gradlew --no-daemon -Dorg.gradle.internal.publish.checksums.insecure=true --parallel -Pversion=$VERSION -PenableJavaFrontend=true -PenableCXXFrontend=true -PenableGoFrontend=true -PenablePythonFrontend=true -PenableLLVMFrontend=true -PenableTypeScriptFrontend=true publish + ./gradlew --no-daemon -Dorg.gradle.internal.publish.checksums.insecure=true --parallel -Pversion=$VERSION -PenableJavaFrontend=true -PenableCXXFrontend=true -PenableGoFrontend=true -PenablePythonFrontend=true -PenableLLVMFrontend=true -PenableTypeScriptFrontend=true publishToSonatype closeSonatypeStagingRepository env: VERSION: ${{ env.version }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSWORD }} diff --git a/build.gradle.kts b/build.gradle.kts index 725ff39e52..6d0ebd5155 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,6 +34,7 @@ import java.io.ByteArrayOutputStream plugins { id("org.jetbrains.dokka") id("org.sonarqube") + id("io.github.gradle-nexus.publish-plugin") } // this is needed for the plugins block @@ -90,6 +91,20 @@ sonarqube { } } +/** + * Publishing to maven central + */ +nexusPublishing { + repositories { + sonatype() { + val mavenCentralUsername: String? by project + val mavenCentralPassword: String? by project + + username.set(mavenCentralUsername) + password.set(mavenCentralPassword) + } + } +} // diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8ccc359397..234798349e 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -11,5 +11,6 @@ dependencies { implementation(libs.dokka.gradle) implementation(libs.sonarqube.gradle) implementation(libs.spotless.gradle) + implementation(libs.nexus.publish.gradle) implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) // this is only there to be able to import 'LibrariesForLibs' in the convention plugins to access the version catalog in buildSrc } diff --git a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts index 1983d0fc7d..e882ee8b6a 100644 --- a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts @@ -6,10 +6,10 @@ plugins { `java-library` jacoco - kotlin("jvm") - id("org.jetbrains.dokka") signing `maven-publish` + kotlin("jvm") + id("org.jetbrains.dokka") } group = "de.fraunhofer.aisec" @@ -79,20 +79,6 @@ publishing { } } } - - repositories { - maven { - url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2") - - credentials { - val mavenCentralUsername: String? by project - val mavenCentralPassword: String? by project - - username = mavenCentralUsername - password = mavenCentralPassword - } - } - } } signing { diff --git a/cpg-language-typescript/build.gradle.kts b/cpg-language-typescript/build.gradle.kts index dfc4cbfd8d..aaa38f32c4 100644 --- a/cpg-language-typescript/build.gradle.kts +++ b/cpg-language-typescript/build.gradle.kts @@ -44,7 +44,7 @@ publishing { node { download.set(findProperty("nodeDownload")?.toString()?.toBoolean() ?: false) - version.set("18.17.0") + version.set("16.20.1") nodeProjectDir.set(file("${project.projectDir.resolve("src/main/nodejs")}")) } diff --git a/cpg-language-typescript/src/main/nodejs/package-lock.json b/cpg-language-typescript/src/main/nodejs/package-lock.json index 4833fcaaf2..3f999ba2d3 100644 --- a/cpg-language-typescript/src/main/nodejs/package-lock.json +++ b/cpg-language-typescript/src/main/nodejs/package-lock.json @@ -6,7 +6,7 @@ "": { "license": "Apache-2.0", "dependencies": { - "@types/node": "18.17.0", + "@types/node": "^16", "typescript": "5.1.3" }, "devDependencies": { @@ -128,9 +128,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.17.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.0.tgz", - "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==" + "version": "16.18.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", + "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==" }, "node_modules/@types/resolve": { "version": "1.20.2", diff --git a/cpg-language-typescript/src/main/nodejs/package.json b/cpg-language-typescript/src/main/nodejs/package.json index 6d0c8f6269..7b2d8d4113 100644 --- a/cpg-language-typescript/src/main/nodejs/package.json +++ b/cpg-language-typescript/src/main/nodejs/package.json @@ -5,7 +5,7 @@ "start": "node src/parser.js" }, "dependencies": { - "@types/node": "18.17.0", + "@types/node": "^16", "typescript": "5.1.3" }, "license": "Apache-2.0", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7c08d8bc98..8cd0897f14 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,6 +4,7 @@ neo4j = "4.0.6" log4j = "2.20.0" sonarqube = "4.2.0.3129" spotless = "6.20.0" +nexus-publish = "1.3.0" [libraries] kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin"} @@ -44,6 +45,7 @@ dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = " dokka-versioning= {module = "org.jetbrains.dokka:versioning-plugin", version = "1.8.10"} sonarqube-gradle = { module = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin", version.ref = "sonarqube" } spotless-gradle = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" } +nexus-publish-gradle = { module = "io.github.gradle-nexus:publish-plugin", version.ref = "nexus-publish" } [bundles] log4j = ["log4j-impl", "log4j-core"] From 2d41fa16048f8b05af0b35cf35b14b94ffc63ea1 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Tue, 25 Jul 2023 20:08:04 +0200 Subject: [PATCH 3/3] Trying to optimize dokka --- .github/workflows/build.yml | 30 ++++++++++++++++++++++-------- jitpack.yml | 6 ------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e7bda4fd4..a1739e55ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,14 +112,6 @@ jobs: with: name: libcpgo-amd64.dylib path: cpg-language-go/src/main/resources/ - - name: Download old dokka versions - run: | - # make sure the previousDocs folder exists - mkdir -p previousDocs && cd previousDocs - # retrieve the previous documentation folders for each published version (this also includes "main") - wget -O - https://github.com/Fraunhofer-AISEC/cpg/archive/gh-pages.tar.gz | tar -xz --strip=2 cpg-gh-pages/dokka || echo "No dokka directory present. Will continue as if nothing happened" - # in order to avoid duplicate mains, remove the "main" version from the previous versions - rm -rf main - name: Build ${{ env.version }} run: | if [ "$SONAR_TOKEN" != "" ] @@ -157,6 +149,22 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSWORD }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + - name: Download old dokka versions (version) + if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'beta') && !contains(github.ref, 'alpha') + run: | + # make sure the previousDocs folder exists + mkdir -p previousDocs && cd previousDocs + # retrieve the previous documentation folders for each published version (this also includes "main") + wget -O - https://github.com/Fraunhofer-AISEC/cpg/archive/gh-pages.tar.gz | tar -xz --strip=2 cpg-gh-pages/dokka || echo "No dokka directory present. Will continue as if nothing happened" + - name: Download old dokka versions (main) + if: github.ref == 'refs/heads/main' + run: | + # make sure the previousDocs folder exists + mkdir -p previousDocs && cd previousDocs + # retrieve the previous documentation folders for each published version (this also includes "main") + wget -O - https://github.com/Fraunhofer-AISEC/cpg/archive/gh-pages.tar.gz | tar -xz --strip=2 cpg-gh-pages/dokka || echo "No dokka directory present. Will continue as if nothing happened" + # in order to avoid duplicate mains, remove the "main" version from the previous versions + rm -rf main - name: Build JavaDoc if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'beta') && !contains(github.ref, 'alpha') || github.ref == 'refs/heads/main' run: | @@ -169,6 +177,12 @@ jobs: with: folder: build/dokkaCustomMultiModuleOutput/${{ env.version }} target-folder: dokka/${{ env.version }} + - name: Publish JavaDoc (version as main) + if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'beta') && !contains(github.ref, 'alpha') + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build/dokkaCustomMultiModuleOutput/${{ env.version }} + target-folder: dokka/main - name: Publish JavaDoc (main) if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@v4 diff --git a/jitpack.yml b/jitpack.yml index 5121af68cf..8f25a3cc8c 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -3,12 +3,6 @@ jdk: before_install: - mkdir -p ~/go - wget -q https://go.dev/dl/go1.20.4.linux-amd64.tar.gz && tar -C ~ -xzf go1.20.4.linux-amd64.tar.gz - - ls -l ~/go - - uname -a - - cat /etc/*-release - - strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC - - apt update -y - - apt upgrade -y libc6 install: - export PATH="$PATH:$HOME/go/bin" - cp gradle.properties.example gradle.properties