Skip to content

Commit

Permalink
CHECKPOINT, the package publication works locally with properties in …
Browse files Browse the repository at this point in the history
…build.gradle, changed to env vars for GitHub
  • Loading branch information
JonasSchaub committed Jul 5, 2023
1 parent a41bb38 commit 4d689e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: Publish package to the Maven Central Repository
on:
push:
branches: [ "main" ]
#release: //TODO: change to this, only running at release
#release: //TODO: change to this, only running at release when fully tested
#types: [created]
jobs:
publish:
Expand Down
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ publishing {
}
repositories {
maven {
//name = "OSSRH"
//these two lines did not work because dir() apparently asks for a local path
//def releasesRepoUrl = layout.buildDirectory.dir('https://s01.oss.sonatype.org/content/repositories/releases/')
//def snapshotsRepoUrl = layout.buildDirectory.dir('https://s01.oss.sonatype.org/content/repositories/snapshots/')
Expand All @@ -185,12 +184,12 @@ publishing {
//after publishing, go to https://s01.oss.sonatype.org, log in, close the staged repo, and release it if everything worked out
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
//uses keys and passwords declared in userhome/.gradle/gradle.properties, works locally
username = property("ossrhUsername") as String
password = property("ossrhPassword") as String
//uses keys and passwords declared in userhome/.gradle/gradle.properties
//username = property("ossrhUsername") as String
//password = property("ossrhPassword") as String
//uses environment variables declared in yml file which passes GitHub secrets to it
//username = System.getenv("MAVEN_USERNAME") as String
//password = System.getenv("MAVEN_PASSWORD") as String
username = System.getenv("MAVEN_USERNAME") as String
password = System.getenv("MAVEN_PASSWORD") as String
}
}
}
Expand Down

0 comments on commit 4d689e2

Please sign in to comment.