Skip to content

Commit

Permalink
New workflow: publish to snapshot repo
Browse files Browse the repository at this point in the history
  • Loading branch information
falkreon committed Jul 17, 2024
1 parent 01aeadc commit c0a96e1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish_snapshot.yml
Original file line number Diff line number Diff line change
@@ -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}}
19 changes: 15 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
artifactId "jankson";
version project.version+versionSuffix;
artifact sourcesJar;
//artifact javadocJar;
artifact javadocJar;

pom {
name = "Jankson";
Expand Down Expand Up @@ -125,6 +125,17 @@ publishing {

}
}

if (project.hasProperty("sleepingUsername")) {
maven {
url "https://repo-api.sleeping.town/"

credentials {
username = sleepingUsername
password = sleepingPassword
}
}
}
}
}

Expand Down

0 comments on commit c0a96e1

Please sign in to comment.