From f5c39a5ea3fb73ec4dab342fba49eae8821c90a9 Mon Sep 17 00:00:00 2001 From: Lamberto Basti Date: Fri, 5 Jul 2024 17:05:00 +0200 Subject: [PATCH] Fixes --- .github/workflows/check.yml | 5 +++- .github/workflows/publish.yml | 5 +++- .gitignore | 2 ++ .../src/main/kotlin/convention.gradle.kts | 23 +++++++++++++++---- gradle.properties | 3 ++- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2102fb6..9b410ca 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,10 +1,13 @@ on: [ pull_request, push ] +name: Test and lint + jobs: build: env: + # to build RocksDB macos is required, but tests do not pass anyway DISABLE_ROCKSDB: true - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: gradle/gradle-build-action@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1fedeee..48b1722 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,11 +4,14 @@ on: release: types: [ published ] +name: Publish to Space + jobs: build: env: + # to build RocksDB macos is required, but tests do not pass anyway DISABLE_ROCKSDB: true - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: gradle/gradle-build-action@v3 diff --git a/.gitignore b/.gitignore index 13ccbe3..b804fed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ build/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ +local.properties +secret.txt ### IntelliJ IDEA ### .idea/ diff --git a/buildSrc/src/main/kotlin/convention.gradle.kts b/buildSrc/src/main/kotlin/convention.gradle.kts index 763860c..f367e30 100644 --- a/buildSrc/src/main/kotlin/convention.gradle.kts +++ b/buildSrc/src/main/kotlin/convention.gradle.kts @@ -75,11 +75,21 @@ fun NamedDomainObjectContainer.silenceOptIns() = all { } } -signing { - val secretKey: String? = System.getenv("SECRET_KEY") - val password: String? = System.getenv("SECRET_KEY_PASSWORD") +val secretKey: String? = System.getenv("SECRET_KEY") + ?: rootProject.file("secret.txt") + .takeIf { it.exists() } + ?.readText() - if (secretKey != null && password != null) { +val password: String? = System.getenv("SECRET_KEY_PASSWORD") + ?: rootProject.file("local.properties") + .readLines() + .map { it.split("=") } + .find { it.first() == "secret.password" } + ?.get(1) + + +if (secretKey != null && password != null) { + signing { useInMemoryPgpKeys(secretKey, password) publishing.publications.all { sign(this) @@ -116,5 +126,10 @@ tasks { check { dependsOn(ktlintCheck) } + + // workaround https://github.com/gradle/gradle/issues/26091 + withType { + dependsOn(withType()) + } } diff --git a/gradle.properties b/gradle.properties index cbd216e..79e28dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,3 @@ org.gradle.jvmargs=-Xmx4g -kotlin.apple.xcodeCompatibility.nowarn=true \ No newline at end of file +kotlin.apple.xcodeCompatibility.nowarn=true +org.gradle.parallel=true \ No newline at end of file