Skip to content

Commit da2410b

Browse files
authored
Migrate publication pipeline on Central Portal from Legacy OSSRH (#171)
* Upgrade gradle and plugins * Upgrade version to 0.5.30 * Fix release to maven central * Fix ubuntu runner
1 parent 5d6f817 commit da2410b

File tree

20 files changed

+89
-42
lines changed

20 files changed

+89
-42
lines changed

.github/workflows/build-and-run-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
name: Run tests
1616
strategy:
1717
matrix:
18-
os: [ ubuntu-20.04, windows-latest, macos-latest ]
18+
os: [ ubuntu-22.04, windows-latest, macos-latest ]
1919

2020
runs-on: ${{ matrix.os }}
2121

2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- name: Set up JDK 1.8
25+
- name: Set up JDK 17
2626
uses: actions/setup-java@v4
2727
with:
28-
java-version: 8
28+
java-version: 17
2929
distribution: 'zulu'
3030
cache: gradle
3131

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Set up JDK 1.8
15+
- name: Set up JDK 17
1616
uses: actions/setup-java@v4
1717
with:
18-
java-version: 8
18+
java-version: 17
1919
distribution: 'zulu'
2020
cache: gradle
2121

@@ -29,7 +29,6 @@ jobs:
2929
publishAllPublicationsToReleaseDirRepository
3030
--no-daemon
3131
-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=2G
32-
-PmavenDeployUrl=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
3332
-PmavenDeployUser=${{ secrets.MAVEN_CENTRAL_USER }}
3433
-PmavenDeployPassword=${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3534
-PmavenSignGpgKey="${{ secrets.MAVEN_SIGN_GPG_KEY }}"

.github/workflows/run-long-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ jobs:
8080
key: test-data-${{ env.TEST_DATA_REVISION }}-${{ matrix.os }}
8181
path: ksmt-test/testData/testData.zip
8282

83-
- name: Set up JDK 1.8
83+
- name: Set up JDK 17
8484
if: steps.test-data-cache.outputs.cache-hit != 'true'
8585
uses: actions/setup-java@v4
8686
with:
87-
java-version: 8
87+
java-version: 17
8888
distribution: 'zulu'
8989
cache: gradle
9090

@@ -131,10 +131,10 @@ jobs:
131131
echo "Test data is not available"
132132
exit 1
133133
134-
- name: Set up JDK 1.8
134+
- name: Set up JDK 17
135135
uses: actions/setup-java@v4
136136
with:
137-
java-version: 8
137+
java-version: 17
138138
distribution: 'zulu'
139139
cache: gradle
140140

@@ -185,10 +185,10 @@ jobs:
185185
with:
186186
path: reports
187187

188-
- name: Set up JDK 1.8
188+
- name: Set up JDK 17
189189
uses: actions/setup-java@v4
190190
with:
191-
java-version: 8
191+
java-version: 17
192192
distribution: 'zulu'
193193

194194
- name: Setup gradle

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Get the most out of SMT solving with KSMT features:
1111
* Streamlined [solver delivery](#ksmt-distribution) with no need for building a solver or implementing JVM bindings
1212

1313
[![KSMT: build](https://github.com/UnitTestBot/ksmt/actions/workflows/build-and-run-tests.yml/badge.svg)](https://github.com/UnitTestBot/ksmt/actions/workflows/build-and-run-tests.yml)
14-
[![Maven Central](https://img.shields.io/maven-central/v/io.ksmt/ksmt-core)](https://central.sonatype.com/artifact/io.ksmt/ksmt-core/0.5.29)
14+
[![Maven Central](https://img.shields.io/maven-central/v/io.ksmt/ksmt-core)](https://central.sonatype.com/artifact/io.ksmt/ksmt-core/0.5.30)
1515
[![javadoc](https://javadoc.io/badge2/io.ksmt/ksmt-core/javadoc.svg)](https://javadoc.io/doc/io.ksmt/ksmt-core)
1616

1717
## Get started
@@ -20,9 +20,9 @@ To start using KSMT, install it via [Gradle](https://gradle.org/):
2020

2121
```kotlin
2222
// core
23-
implementation("io.ksmt:ksmt-core:0.5.29")
23+
implementation("io.ksmt:ksmt-core:0.5.30")
2424
// z3 solver
25-
implementation("io.ksmt:ksmt-z3:0.5.29")
25+
implementation("io.ksmt:ksmt-z3:0.5.30")
2626
```
2727

2828
Find basic instructions in the [Getting started](docs/getting-started.md) guide and try it out with the

build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
plugins {
2+
id("com.gradleup.nmcp.aggregation") version "0.1.3"
3+
}
4+
5+
val mavenDeployUser = project.stringProperty("mavenDeployUser")
6+
if (mavenDeployUser != null) {
7+
val mavenDeployPassword = project.stringProperty("mavenDeployPassword") ?: ""
8+
9+
nmcpAggregation {
10+
centralPortal {
11+
username.set(mavenDeployUser)
12+
password.set(mavenDeployPassword)
13+
publishingType.set("USER_MANAGED")
14+
}
15+
16+
// Publish all projects that apply the 'maven-publish' plugin
17+
publishAllProjectsProbablyBreakingProjectIsolation()
18+
}
19+
}

buildSrc/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ dependencies {
1919
implementation("de.undercouch.download:de.undercouch.download.gradle.plugin:5.1.0")
2020
}
2121

22+
tasks.withType<JavaCompile> {
23+
targetCompatibility = JavaVersion.VERSION_1_8.toString()
24+
}
25+
2226
tasks.withType<KotlinCompile> {
2327
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
2428
}

buildSrc/src/main/kotlin/Publications.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import gradle.kotlin.dsl.accessors._87b80c14bf1c4d505c7a71d7741e0994.publishing
2-
import gradle.kotlin.dsl.accessors._87b80c14bf1c4d505c7a71d7741e0994.signing
1+
import gradle.kotlin.dsl.accessors._a772fae24f61b6fdfe5e797ccdf7ddf5.publishing
2+
import gradle.kotlin.dsl.accessors._a772fae24f61b6fdfe5e797ccdf7ddf5.signing
33
import groovy.util.Node
44
import org.gradle.api.Project
55
import org.gradle.api.artifacts.Dependency
@@ -50,6 +50,12 @@ fun MavenPublication.addKsmtPom() {
5050
}
5151
}
5252

53+
fun MavenPublication.generateMavenMetadata(project: Project) {
54+
project.tasks.getByName("generateMetadataFileForMavenPublication") {
55+
mustRunAfter(project.tasks.named("jar"))
56+
}
57+
}
58+
5359
fun MavenPublication.signKsmtPublication(project: Project) = with(project) {
5460
signing {
5561
val gpgKey = project.stringProperty("mavenSignGpgKey")?.removeSurrounding("\"")

buildSrc/src/main/kotlin/io.ksmt.ksmt-base.gradle.kts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group = "io.ksmt"
14-
version = "0.5.29"
14+
version = "0.5.30"
1515

1616
repositories {
1717
mavenCentral()
@@ -31,6 +31,10 @@ detekt {
3131
config = files(rootDir.resolve("detekt.yml"))
3232
}
3333

34+
tasks.withType<JavaCompile> {
35+
targetCompatibility = JavaVersion.VERSION_1_8.toString()
36+
}
37+
3438
tasks.withType<KotlinCompile> {
3539
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
3640
}
@@ -56,18 +60,5 @@ publishing {
5660
name = "releaseDir"
5761
url = uri(layout.buildDirectory.dir("release"))
5862
}
59-
60-
val mavenDeployUrl = project.stringProperty("mavenDeployUrl")
61-
if (mavenDeployUrl != null) {
62-
maven {
63-
name = "central"
64-
url = uri(mavenDeployUrl)
65-
66-
credentials {
67-
username = project.stringProperty("mavenDeployUser") ?: ""
68-
password = project.stringProperty("mavenDeployPassword") ?: ""
69-
}
70-
}
71-
}
7263
}
7364
}

docs/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repositories {
3434
```kotlin
3535
dependencies {
3636
// core
37-
implementation("io.ksmt:ksmt-core:0.5.29")
37+
implementation("io.ksmt:ksmt-core:0.5.30")
3838
}
3939
```
4040

@@ -43,9 +43,9 @@ dependencies {
4343
```kotlin
4444
dependencies {
4545
// z3
46-
implementation("io.ksmt:ksmt-z3:0.5.29")
46+
implementation("io.ksmt:ksmt-z3:0.5.30")
4747
// bitwuzla
48-
implementation("io.ksmt:ksmt-bitwuzla:0.5.29")
48+
implementation("io.ksmt:ksmt-bitwuzla:0.5.30")
4949
}
5050
```
5151

examples/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ repositories {
99

1010
dependencies {
1111
// core
12-
implementation("io.ksmt:ksmt-core:0.5.29")
12+
implementation("io.ksmt:ksmt-core:0.5.30")
1313
// z3 solver
14-
implementation("io.ksmt:ksmt-z3:0.5.29")
14+
implementation("io.ksmt:ksmt-z3:0.5.30")
1515
// Runner and portfolio solver
16-
implementation("io.ksmt:ksmt-runner:0.5.29")
16+
implementation("io.ksmt:ksmt-runner:0.5.30")
1717
}
1818

1919
java {

0 commit comments

Comments
 (0)