Skip to content

Commit d3b9659

Browse files
Merge pull request #361 from ie3-institute/sp/#0-merge-back
Merge back changes from main
2 parents ce9d391 + 853a8f9 commit d3b9659

File tree

10 files changed

+85
-27
lines changed

10 files changed

+85
-27
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,17 @@ jobs:
8484
8585
#Deployment
8686
- name: Deploy
87-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
87+
if: github.ref == 'refs/heads/main'
8888
env:
8989
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVENCENTRAL_SIGNINGKEY }}
9090
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVENCENTRAL_SIGNINGPASS }}
91-
ORG_GRADLE_PROJECT_user: ${{ secrets.MAVENCENTRAL_USER }}
92-
ORG_GRADLE_PROJECT_password: ${{ secrets.MAVENCENTRAL_PASS }}
91+
ORG_GRADLE_PROJECT_mavenCentralUser: ${{ github.actor == 'sebastian-peter' && secrets.MAVENCENTRAL_USER ||
92+
github.actor == 'danielfeismann' && secrets.MAVENCENTRAL_DANIEL_USER }}
93+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ github.actor == 'sebastian-peter' && secrets.MAVENCENTRAL_PASS ||
94+
github.actor == 'danielfeismann' && secrets.MAVENCENTRAL_DANIEL_PASS }}
95+
9396
run: |
97+
echo "Using MavenCentral Token of GitHub Actor: ${{ github.actor }}"
9498
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
9599
currentVersion=$(./gradlew -q currentVersion)
96100
else
@@ -100,3 +104,18 @@ jobs:
100104
echo "currentVersion=$currentVersion"
101105
102106
./gradlew publish -PdeployVersion=$currentVersion
107+
108+
109+
#MavenCentral Staging
110+
- name: MavenCentral Staging
111+
if: github.ref == 'refs/heads/main'
112+
env:
113+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVENCENTRAL_SIGNINGKEY }}
114+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVENCENTRAL_SIGNINGPASS }}
115+
ORG_GRADLE_PROJECT_mavenCentralUser: ${{ github.actor == 'sebastian-peter' && secrets.MAVENCENTRAL_USER ||
116+
github.actor == 'danielfeismann' && secrets.MAVENCENTRAL_DANIEL_USER }}
117+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ github.actor == 'sebastian-peter' && secrets.MAVENCENTRAL_PASS ||
118+
github.actor == 'danielfeismann' && secrets.MAVENCENTRAL_DANIEL_PASS }}
119+
120+
run: |
121+
./gradlew stagingAtMavenCentralPortal

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9797
- Renamed messages to ease understanding [#62](https://github.com/ie3-institute/simonaAPI/issues/62)
9898
- Separating departures and arrivals in message protocol, properly handling exceptions [#77](https://github.com/ie3-institute/simonaAPI/issues/77)
9999

100-
[Unreleased/Snapshot]: https://github.com/ie3-institute/simonaapi/compare/0.9.0...HEAD
100+
[Unreleased/Snapshot]: https://github.com/ie3-institute/simonaapi/compare/0.10.0...HEAD
101+
[0.10.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.9.0...0.10.0
101102
[0.9.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.8.0...0.9.0
102103
[0.8.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.7.0...0.8.0
103104
[0.7.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.6.0...0.7.0

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ apply from: scriptsLocation + 'spotbugs.gradle'
3636
apply from: scriptsLocation + 'sonarqube.gradle'
3737
apply from: scriptsLocation + 'checkJavaVersion.gradle'
3838
apply from: scriptsLocation + 'semVer.gradle'
39-
apply from: scriptsLocation + 'mavenCentralPublish.gradle'
39+
apply from: scriptsLocation + 'uploadToMavenCentralPortal.gradle' // upload for deploy
40+
apply from: scriptsLocation + 'stagingAtMavenCentralPortal.gradle' // stage for deploy
4041
apply from: scriptsLocation + 'jacoco.gradle'
4142
apply from: scriptsLocation + 'documentation.gradle'
4243
apply from: scriptsLocation + 'test.gradle'
@@ -81,6 +82,7 @@ dependencies{
8182
testImplementation "org.apache.pekko:pekko-actor-testkit-typed_${scalaVersion}:${pekkoVersion}" // pekko typed testkit
8283

8384
// TESTING
85+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
8486
testImplementation 'org.apache.groovy:groovy:4.0.28'
8587
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
8688
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
tasks.register('stagingAtMavenCentralPortal') {
2+
group = 'publishing'
3+
description = 'Stages uploaded artifacts to Maven Central Portal for manual approval'
4+
5+
doLast {
6+
def username = project.getProperty('mavenCentralUser')
7+
def password = project.getProperty('mavenCentralPassword')
8+
def deployVersion = project.findProperty('deployVersion') ?: project.version
9+
10+
if (!username || !password) {
11+
throw new GradleException("Sonatype credentials not found. Set sonatypeUser and sonatypePassword properties or environment variables.")
12+
}
13+
14+
// Request API for repo key
15+
def repositoryString = providers.exec {
16+
commandLine 'curl',
17+
'-u', "${username}:${password}",
18+
'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories'
19+
}.getStandardOutput().getAsText().get()
20+
21+
def repositoryGroovy = new groovy.json.JsonSlurper().parseText(repositoryString)
22+
def key = repositoryGroovy.repositories[0].key
23+
24+
// Stage via curl
25+
def stageResult = providers.exec {
26+
ignoreExitValue true
27+
commandLine 'curl',
28+
'-u', "${username}:${password}",
29+
'-i', '-X', 'POST', "https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$key"
30+
}
31+
32+
if (stageResult.result.get().exitValue == 0) {
33+
println "✓ Staging successful!"
34+
println "Check status at: https://central.sonatype.com/publishing/deployments"
35+
} else {
36+
throw new GradleException("Staging failed")
37+
}
38+
}
39+
}

gradle/scripts/mavenCentralPublish.gradle renamed to gradle/scripts/uploadToMavenCentralPortal.gradle

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Maven publish - start */
2+
23
tasks.register("sourcesJar", Jar) {
34
archiveClassifier.set("sources")
45
from sourceSets.main.allJava
@@ -10,13 +11,11 @@ tasks.register("javadocJar", Jar) {
1011
from { tasks.named("javadoc", Javadoc).get().destinationDir }
1112
}
1213

13-
14-
if (project.hasProperty('user') && project.hasProperty('password') && project.hasProperty('deployVersion')) {
14+
if (project.hasProperty('mavenCentralUser') && project.hasProperty('mavenCentralPassword') && project.hasProperty('deployVersion')) {
1515

1616
// snapshot version differs from normal version
1717
String versionString = project.getProperty('deployVersion')
1818

19-
2019
publishing {
2120
publications {
2221
create("mavenJava", MavenPublication) {
@@ -31,8 +30,8 @@ if (project.hasProperty('user') && project.hasProperty('password') && project.ha
3130
}
3231
}
3332
pom {
34-
description = 'API of the simona power system simulation model'
35-
name = 'Simona API'
33+
description = 'API to create modules and add-ons for simona'
34+
name = 'simonaAPI'
3635
url = 'https:github.com/ie3-institute/simonaAPI'
3736
organization {
3837
name = 'Institute of Energy Systems, Energy Efficiency and Energy Economics (ie3)/TU Dortmund University'
@@ -67,18 +66,17 @@ if (project.hasProperty('user') && project.hasProperty('password') && project.ha
6766
version = versionString
6867

6968
from components.java
70-
artifact tasks.named("sourcesJar")
71-
artifact tasks.named("javadocJar")
69+
artifact sourcesJar
70+
artifact javadocJar
7271
}
7372
}
7473
repositories {
7574
maven {
76-
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
77-
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
78-
url = versionString.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
75+
name = "MavenCentral"
76+
url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
7977
credentials {
80-
username project.getProperty('user')
81-
password project.getProperty('password')
78+
username = project.findProperty('mavenCentralUser')
79+
password = project.findProperty('mavenCentralPassword')
8280
}
8381
}
8482
}
@@ -97,7 +95,6 @@ if (project.hasProperty('user') && project.hasProperty('password') && project.ha
9795
}
9896

9997
def removeTestDependenciesFromPom(pom) {
100-
10198
pom.withXml {
10299
def root = asNode()
103100
// eliminate test-scoped dependencies (no need in maven central POMs)
@@ -107,4 +104,4 @@ def removeTestDependenciesFromPom(pom) {
107104
}
108105
}
109106

110-
/* Maven publish - end */
107+
/* Maven publish - end */

gradle/wrapper/gradle-wrapper.jar

59 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

version.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#Generated by the Semver Plugin for Gradle
2-
#Fri May 09 11:28:30 CEST 2025
2+
#Tue Oct 21 14:53:05 CEST 2025
33
version.buildmeta=
44
version.major=0
5-
version.minor=10
5+
version.minor=11
66
version.patch=0
77
version.prerelease=
8-
version.semver=0.10.0
8+
version.semver=0.11.0

0 commit comments

Comments
 (0)