diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9dc57f0..fc162b9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,7 +111,17 @@ jobs: steps: - uses: actions/checkout@master - + to-master: + needs: [gh-release] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Merge to master branch + uses: devmasx/merge-branch@v1.3.1 + with: + type: now + target_branch: master + github_token: ${{ github.token }} gh-release: needs: [release-flag, to-staging] diff --git a/README.md b/README.md index 82562e9..df218dd 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ publishing { rootProject.name = "mylib" ``` -## Running +## Publishing ### Publish to Maven Central @@ -156,11 +156,6 @@ java -jar mavence.jar local io.github.doe:mylib ### Publish to Staging -This will push the package to -a [temporary remote repository](https://s01.oss.sonatype.org/content/repositories/) -. This way you can -test the package without sending it to Central. - Set environment variables `MAVEN_GPG_KEY`, `MAVEN_GPG_PASSWORD` , `SONATYPE_USERNAME`, `SONATYPE_PASSWORD` and run: @@ -169,6 +164,34 @@ cd /path/to/mylib java -jar mavence.jar stage io.github.doe:mylib ``` +This will push the package to +a [temporary remote repository](https://s01.oss.sonatype.org/content/repositories/). +This way you can test the package without sending it to Central. + +## Testing before publishing + +Although the utility prints quite a lot, `stdout` remains clean and only +prints the result as JSON. + +Bash: +```bash +JSON=$(java -jar mavence.jar local dev.domain:artifactus) + +echo $JSON +``` +Output: +```json +{ "group": "dev.domain", + "artifact": "artifactus", + "version": "1.2.3", + "notation": "dev.domain:artifactus:1.2.3", + "mavenRepo": "file:///home/doe/.m2" } +``` + +Using this data, you can test the package before it is sent. + +I usually use Python and [tempground](https://pypi.org/project/tempground/) for such testing. + ## Keep in mind - Sonatype servers may not respond. If you see a lot of timeout errors, diff --git a/build.gradle.kts b/build.gradle.kts index 847b162..1099018 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,11 +6,10 @@ plugins { kotlin("jvm") version "1.7.20" kotlin("plugin.serialization") version "1.7.20" application - } group = "io.github.rtmigo" -version = "0.1.0" // -SNAPSHOT +version = "0.1.1" repositories { mavenCentral() @@ -23,13 +22,13 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0") // testing testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.0") // testing - testImplementation("io.kotest:kotest-assertions-core:5.5.0")// testing + testImplementation("io.kotest:kotest-assertions-core:5.5.1")// testing implementation("com.github.pgreze:kotlin-process:1.4") // running processes implementation("com.github.aballano:mnemonik:2.1.1") // caching function results implementation("com.github.ajalt.clikt:clikt:3.5.0") // parsing cli args - implementation("org.jsoup:jsoup:1.14.3") // parsing xml + implementation("org.jsoup:jsoup:1.15.3") // parsing xml implementation("org.jline:jline:3.21.0") // terminal size implementation("org.redundent:kotlin-xml-builder:1.8.0") // building XML (unused) @@ -99,6 +98,5 @@ tasks.register("uberJar") { doLast { println("JAR size %.2f MB".format(archiveFile.get().asFile.length() / 1_000_000.0)) println("Run with: alias ${archiveBaseName.get()}='java -jar ${archiveFile.get()}'") - //#println("OR: java -jar ${archiveFile.get()}") } } \ No newline at end of file diff --git a/src/main/kotlin/stages/build/Building.kt b/src/main/kotlin/stages/build/Building.kt index 9610c08..5ecc138 100644 --- a/src/main/kotlin/stages/build/Building.kt +++ b/src/main/kotlin/stages/build/Building.kt @@ -49,7 +49,7 @@ suspend fun cmdLocal(ga: GroupArtifact, isFinal: Boolean = false): MavenArtifact version = nota.version.string, artifact = nota.artifact.string, notation = nota.toString(), - mavenRepo = "file://$m2str" + mavenUrl = "file://$m2str" ) )) } @@ -63,5 +63,5 @@ private data class BuildStdout( val artifact: String, val version: String, val notation: String, - val mavenRepo: String + val mavenUrl: String ) \ No newline at end of file