Skip to content

Commit caeaf04

Browse files
Merge remote-tracking branch 'origin/df/#1373-merge-back-main-v8.0.0' into df/#1357-validation-load
2 parents ff0e7ee + 37dd33e commit caeaf04

File tree

5 files changed

+77
-11
lines changed

5 files changed

+77
-11
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ jobs:
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' || github.ref == 'refs/heads/dev'
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: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased/Snapshot]
88

9+
### Added
10+
11+
### Fixed
12+
13+
### Changed
14+
15+
## [8.0.0] - 2025-07-22
16+
917
### Added
1018
- Extend Validation to EnergyManagement Systems. [#1356](https://github.com/ie3-institute/PowerSystemDataModel/issues/1356)
1119
- Added `CITATION.cff` [#1380](https://github.com/ie3-institute/PowerSystemDataModel/issues/1380)
@@ -373,7 +381,8 @@ coordinates or multiple exactly equal coordinates possible
373381
- CsvDataSource now stops trying to get an operator for empty operator uuid field in entities
374382
- CsvDataSource now parsing multiple geoJson strings correctly
375383

376-
[Unreleased/Snapshot]: https://github.com/ie3-institute/powersystemdatamodel/compare/7.0.0...HEAD
384+
[Unreleased/Snapshot]: https://github.com/ie3-institute/powersystemdatamodel/compare/8.0.0...HEAD
385+
[8.0.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/7.0.0...8.0.0
377386
[7.0.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/6.0.0...7.0.0
378387
[6.0.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/5.1.0...6.0.0
379388
[5.1.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/5.0.1...5.1.0

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ apply from: scriptsLocation + 'spotless.gradle'
4141
apply from: scriptsLocation + 'checkJavaVersion.gradle'
4242
apply from: scriptsLocation + 'documentation.gradle'
4343
apply from: scriptsLocation + 'jacoco.gradle' // jacoco java code coverage
44-
apply from: scriptsLocation + 'mavenCentralPublish.gradle'
44+
apply from: scriptsLocation + 'uploadToMavenCentralPortal.gradle' // upload for deploy
45+
apply from: scriptsLocation + 'stagingAtMavenCentralPortal.gradle' // stage for deploy
4546
apply from: scriptsLocation + 'sonarqube.gradle'
4647
apply from: scriptsLocation + 'vcs.gradle'
4748
apply from: scriptsLocation + 'semVer.gradle'
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: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ tasks.register("javadocJar", Jar) {
1111
from { tasks.named("javadoc", Javadoc).get().destinationDir }
1212
}
1313

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) {
@@ -73,12 +72,11 @@ if (project.hasProperty('user') && project.hasProperty('password') && project.ha
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
}

0 commit comments

Comments
 (0)