diff --git a/.github/workflows/publish_snapshot.yml b/.github/workflows/publish_snapshot.yml new file mode 100644 index 0000000..9d16719 --- /dev/null +++ b/.github/workflows/publish_snapshot.yml @@ -0,0 +1,25 @@ +name: Build and publish snapshot + +on: [push] + +jobs: + publish: + name: Publish `-SNAPSHOT` artifact to Sleeping Town maven + runs-on: ubuntu-latest + needs: build + if: (github.event_name == 'push' && github.ref_name == 'main') + environment: publishing + steps: + - name: git checkout + uses: actions/checkout@v3 + + - name: Setup Java 21 + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: "21" + + - name: Publish with Gradle + uses: gradle/gradle-build-action@v2.4.2 + with: + arguments: clean build publish --info --stacktrace -PsleepingUsername=${{secrets.SLEEPING_USERNAME}} -PsleepingPassword=${{secrets.SLEEPING_PASSWORD}} diff --git a/build.gradle b/build.gradle index c7544aa..eaa33ec 100644 --- a/build.gradle +++ b/build.gradle @@ -45,13 +45,13 @@ task sourcesJar(type: Jar, dependsOn: classes) { from sourceSets.main.allSource } -/* + task javadocJar(type: Jar, dependsOn: javadoc) { archiveClassifier = "javadoc" from javadoc.destinationDir -}*/ +} -javadoc { +tasks.withType(org.gradle.api.tasks.javadoc.Javadoc) { failOnError false //options.addBooleanOption("Xdoclint:none", true) options.addStringOption("Xdoclint:none", "-quiet") @@ -79,7 +79,7 @@ publishing { artifactId "jankson"; version project.version+versionSuffix; artifact sourcesJar; - //artifact javadocJar; + artifact javadocJar; pom { name = "Jankson"; @@ -125,6 +125,17 @@ publishing { } } + + if (project.hasProperty("sleepingUsername")) { + maven { + url "https://repo-api.sleeping.town/" + + credentials { + username = sleepingUsername + password = sleepingPassword + } + } + } } }