Skip to content

Commit

Permalink
fix release build handling on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 committed Jul 5, 2024
1 parent 0563193 commit fbd8223
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/ci-gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ org.jetbrains.compose.experimental.macos.enabled=true
org.gradle.configuration-cache.problems=warn
nl.littlerobots.vcu.resolver=true
org.gradle.console=plain
CI=true
release=true
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
run: ./gradlew publishToMavenCentral --no-configuration-cache

- name: Generate Changelog
uses: mikepenz/release-changelog-builder-action@v4
Expand Down
10 changes: 0 additions & 10 deletions buildSrc/src/main/kotlin/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.getByType
import org.gradle.plugin.use.PluginDependency
import java.io.File
import java.io.FileInputStream
import java.util.Base64
import java.util.Properties

/**
* Load version catalog for usage in places where it is not available yet with gradle 7.x.
Expand Down Expand Up @@ -49,13 +46,6 @@ fun List<String>.toJavaArrayString() = buildString {

fun String.toBase64() = Base64.getEncoder().encodeToString(toByteArray())

fun Project.localProperties() = Properties().apply {
val file = File(rootProject.rootDir.absolutePath, "local.properties")
if (file.exists()) {
load(FileInputStream(file))
}
}

fun stabilityLevel(version: String): Int {
Config.stabilityLevels.forEachIndexed { index, postfix ->
val regex = """.*[.\-]$postfix[.\-\d]*""".toRegex(RegexOption.IGNORE_CASE)
Expand Down
4 changes: 1 addition & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ dependencies {
}

mavenPublishing {
val properties = localProperties()
val isReleaseBuild = properties["release"]?.toString().toBoolean()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, false)
signAllPublications()
if (isReleaseBuild) signAllPublications()
coordinates(Config.group, Config.artifact, Config.version(isReleaseBuild))
pom {
name = Config.name
Expand All @@ -43,6 +42,5 @@ mavenPublishing {
scm {
url = Config.scmUrl
}

}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ android.nonFinalResIds=true
kotlinx.atomicfu.enableJvmIrTransformation=true
org.gradle.configuration-cache.problems=warn
nl.littlerobots.vcu.resolver=true
release=false

0 comments on commit fbd8223

Please sign in to comment.