Skip to content

Commit

Permalink
!!release
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmigo committed Oct 20, 2022
1 parent cccebcc commit 75b8a1d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 14 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
type: now
target_branch: master
github_token: ${{ github.token }}

gh-release:
needs: [release-flag, to-staging]
Expand Down
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ publishing {
rootProject.name = "mylib"
```

## Running
## Publishing

### Publish to Maven Central

Expand Down Expand Up @@ -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:

Expand All @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -99,6 +98,5 @@ tasks.register<Jar>("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()}")
}
}
4 changes: 2 additions & 2 deletions src/main/kotlin/stages/build/Building.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
))
}
Expand All @@ -63,5 +63,5 @@ private data class BuildStdout(
val artifact: String,
val version: String,
val notation: String,
val mavenRepo: String
val mavenUrl: String
)

0 comments on commit 75b8a1d

Please sign in to comment.