Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable automatic nexus publishing #744

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/publish-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ jobs:
ORG_GRADLE_PROJECT_DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish maven artifacts
run: ./gradlew publish
run: ./gradlew publish closeAndReleaseStagingRepositories
env:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}
ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/springwolf-addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
1 change: 0 additions & 1 deletion .github/workflows/springwolf-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
1 change: 0 additions & 1 deletion .github/workflows/springwolf-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
1 change: 0 additions & 1 deletion .github/workflows/springwolf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
1 change: 0 additions & 1 deletion .github/workflows/springwolf-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,5 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
1 change: 0 additions & 1 deletion .github/workflows/springwolf-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

Expand Down
8 changes: 2 additions & 6 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ The following list describe the steps necessary to release a new version.
3. Update `all-contributors` in [README.md](README.md)
4. Remove the `-SNAPHSOT` postfix in `.env`, create a new branch `release/0.X.X` (version number), commit & push
5. Run GitHub `Publish releases` pipeline from the newly created release branch
1. The stage artifacts can be viewed in https://s01.oss.sonatype.org/#view-repositories
2. To view them, select `Nexus Managed Repositories` in the drop-down and search for springwolf in the searchbox
6. Release version in nexus
1. Artifacts are visible in the public maven repository: https://repo1.maven.org/maven2/io/github/springwolf/
7. Update version number on website
8. Update the version number in `.env` for next snapshot on branch `master`, commit & push
6. Update version number on website
7. Update the version number in `.env` for next snapshot on branch `master`, commit & push
45 changes: 22 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
}

plugins {
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'ca.cutterslade.analyze' version '1.9.1'
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'org.springframework.boot' version '3.2.5' apply false
Expand Down Expand Up @@ -91,7 +92,6 @@ allprojects {
exceptionFormat = 'full'
}
}

tasks.register('unitTest', Test) {
enabled = !it.project.name.contains("-example") // Examples do not contain unit tests and would fail otherwise
dependsOn spotlessApply // Automatically fix code formatting if possible
Expand All @@ -110,8 +110,6 @@ allprojects {
exceptionFormat = 'full'
}
}


tasks.register('integrationTest', Test) {
dependsOn spotlessApply // Automatically fix code formatting if possible

Expand All @@ -130,6 +128,19 @@ allprojects {
}
}

tasks.register('updateAsyncApiJson') {
group 'verification'
description 'Update the AsyncAPI JSON files in the examples to match the current state of the plugin'

doLast { // ensure that the code is not executed as part of a gradle refresh
plugins.forEach {
project
.file('springwolf-examples/' + it + '-example/src/test/resources/asyncapi.actual.json')
.renameTo('springwolf-examples/' + it + '-example/src/test/resources/asyncapi.json')
}
}
}

var addons = [
'springwolf-common-model-converters' ,
'springwolf-generic-binding' ,
Expand Down Expand Up @@ -212,16 +223,6 @@ allprojects {
}
}
}

repositories {
maven {
url = project.findProperty('MAVEN_URL')
credentials {
username = project.findProperty('MAVEN_USERNAME') ?: ''
password = project.findProperty('MAVEN_PASSWORD') ?: ''
}
}
}
}

signing {
Expand All @@ -231,17 +232,15 @@ allprojects {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
}

tasks.register('updateAsyncApiJson') {
group 'verification'
description 'Update the AsyncAPI JSON files in the examples to match the current state of the plugin'

doLast { // ensure that the code is not executed as part of a gradle refresh
plugins.forEach {
project
.file('springwolf-examples/' + it + '-example/src/test/resources/asyncapi.actual.json')
.renameTo('springwolf-examples/' + it + '-example/src/test/resources/asyncapi.json')
}
nexusPublishing {
repositories {
MavenRepository {
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/')
snapshotRepositoryUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
username = project.findProperty('MAVEN_USERNAME') ?: ''
password = project.findProperty('MAVEN_PASSWORD') ?: ''
}
}
}
Expand Down