Skip to content

Commit

Permalink
ci: setup a workflow to publish development versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Prototik committed Jan 10, 2024
1 parent 8adf47c commit e3e4ee9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ jobs:
contents: write
env:
NYX_RESUME: true
RELEASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
Expand Down
14 changes: 14 additions & 0 deletions .nyx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ changelog:
releaseTypes:
enabled:
- mainline
- integration
- internal
publicationServices:
- github
Expand All @@ -24,6 +25,19 @@ releaseTypes:
CI: "^true$"
matchWorkspaceStatus: "CLEAN"
publish: "true"
integration:
collapseVersions: true
collapsedVersionQualifier: "{{#sanitizeLower}}{{branch}}{{/sanitizeLower}}"
description: "{{#file.content}}build/CHANGELOG.md{{/file.content}}"
filterTags: "^({{configuration.releasePrefix}})?([0-9]\\d*)\\.([0-9]\\d*)\\.([0-9]\\d*)(-(develop|development|integration|latest)(\\.([0-9]\\d*))?)$"
gitCommit: "false"
gitPush: "true"
gitTag: "true"
matchBranches: "^(develop|development|integration|latest)$"
matchWorkspaceStatus: "CLEAN"
publish: "true"
publishPreRelease: "true"
versionRangeFromBranchName: false
internal:
description: "{{#fileContent}}build/CHANGELOG.md{{/fileContent}}"
collapseVersions: true
Expand Down
21 changes: 13 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@file:Suppress("UnstableApiUsage")

import org.jetbrains.kotlin.gradle.dsl.*
import org.jetbrains.kotlin.gradle.plugin.*
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import com.mooltiverse.oss.nyx.state.State as NyxState

plugins {
`jvm-test-suite`
Expand All @@ -12,6 +14,8 @@ plugins {
embeddedKotlin("plugin.serialization")
}

val nyxState: NyxState by extraProperties

allprojects {
pluginManager.withPlugin("org.gradle.java-base") {
java {
Expand Down Expand Up @@ -70,7 +74,7 @@ allprojects {
}
}

tasks.register("publishAllPublicationsToKkIncRepository") {
val publishAllPublicationsToKkIncRepository by tasks.registering {
dependsOn(
if (project.version.toString().endsWith("-SNAPSHOT")) {
"publishAllPublicationsToKkIncSnapshotsRepository"
Expand All @@ -79,6 +83,10 @@ allprojects {
}
)
}

tasks.nyxPublish {
dependsOn(publishAllPublicationsToKkIncRepository)
}
}
}

Expand Down Expand Up @@ -225,7 +233,7 @@ gradlePlugin {
}

signing {
isRequired = System.getenv("RELEASE") == "true"
isRequired = nyxState.coreVersion
val signingKeyId: String? by project
val signingKey: String? by project
val signingPassword: String? by project
Expand All @@ -234,13 +242,10 @@ signing {
}

tasks {
clean {
dependsOn(nyxClean)
}
nyxMake {
dependsOn(assemble)
publishPlugins {
onlyIf { nyxState.coreVersion }
}
nyxPublish {
dependsOn("publishAllPublicationsToKkIncRepository", "publishPlugins")
dependsOn(publishPlugins)
}
}

0 comments on commit e3e4ee9

Please sign in to comment.