Skip to content

Commit

Permalink
add gradle nexus plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-kerem committed Dec 10, 2024
1 parent c9cf291 commit bec7fc0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/espresso-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,21 @@ jobs:
- name: Bump version
id: upgrade
run: |
./gradlew --no-daemon -q bumpVersion -PreleaseType=${{ github.event.inputs.releaseType }}
./gradlew -q bumpVersion -PreleaseType=${{ github.event.inputs.releaseType }}
echo "version=$new_version" >> "$GITHUB_OUTPUT"
- name: Publish artifacts
- name: Publish to Sonatype OSSRH (staging)
run: ./gradlew publish
env:
OSSRH_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }}

- name: Close and release the repository
run: ./gradlew nexusStagingRelease
env:
OSSRH_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }}

- name: Push new version to Git
id: push_to_git
run: |
Expand Down
12 changes: 11 additions & 1 deletion visual-espresso/visual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,17 @@ publishing {
}
repositories {
mavenLocal()

}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
username = project.findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}

Expand Down

0 comments on commit bec7fc0

Please sign in to comment.