Skip to content

Commit

Permalink
fix publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jawnnypoo committed Jan 17, 2024
1 parent 62bc964 commit 4fa2250
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: sed -i "s/VERSION_NAME=0.0.1/VERSION_NAME=$GITHUB_REF_NAME/" gradle.properties

- name: Upload release
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ gimbal = { group = "com.github.Commit451", name = "Gimbal", version = "3.0.0" }
org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "org-jetbrains-kotlin-android" }
com-android-application = { id = "com.android.application", version.ref = "agp" }
com-android-library = { id = "com.android.library", version.ref = "agp" }
com-vanniktech-publish = { id = "com.vanniktech.maven.publish", version = "0.18.0" }
com-vanniktech-publish = { id = "com.vanniktech.maven.publish", version = "0.27.0" }
19 changes: 16 additions & 3 deletions physicslayout/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.SonatypeHost

plugins {
Expand All @@ -24,9 +25,21 @@ dependencies {
api(libs.translation.drag.view.helper)
}

mavenPublish {
sonatypeHost = SonatypeHost.S01
mavenPublishing {
configure(
AndroidSingleVariantLibrary(
// the published variant
variant = "release",
// whether to publish a sources jar
sourcesJar = true,
// whether to publish a javadoc jar
publishJavadocJar = true,
)
)
publishToMavenCentral(SonatypeHost.S01)
// We need this, because on Jitpack, we don't want the release to be signed,
// but on GitHub actions, we do, since it will be published to Maven Central
releaseSigningEnabled = System.getenv("RELEASE_SIGNING_ENABLED") == "true"
if (System.getenv("RELEASE_SIGNING_ENABLED") == "true") {
signAllPublications()
}
}

0 comments on commit 4fa2250

Please sign in to comment.