Skip to content

Commit 65a2522

Browse files
committed
trying to configure workflow
1 parent b62f44c commit 65a2522

File tree

2 files changed

+37
-60
lines changed

2 files changed

+37
-60
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
distribution: 'zulu'
1616
java-version: 21
1717
- name: Publish to MavenCentral
18-
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
18+
run: ./gradlew publishToMavenCentral --no-configuration-cache
1919
env:
20-
ORG_GRADLE_PROJECT_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
21-
ORG_GRADLE_PROJECT_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
20+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
21+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
2222
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
2323
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
2424
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}

pdf_reader/build.gradle.kts

Lines changed: 34 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,13 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
13
plugins {
24
alias(libs.plugins.android.library)
35
alias(libs.plugins.kotlin.android)
46
alias(libs.plugins.kotlin.compose)
57
alias(libs.plugins.kotlin.serialization)
68
id("maven-publish")
79
id("signing")
8-
}
9-
10-
publishing {
11-
publications {
12-
create<MavenPublication>("release") {
13-
14-
groupId = "ru.marat"
15-
artifactId = "pdfviewer"
16-
version = "1.0.0-alpha"
17-
18-
signing {
19-
useInMemoryPgpKeys(
20-
System.getenv("signingInMemoryKeyId"),
21-
System.getenv("signingInMemoryKey"),
22-
System.getenv("signingInMemoryKeyPassword")
23-
)
24-
}
25-
26-
pom {
27-
name = "PdfViewer"
28-
description = "Android PdfViewer library"
29-
url = "https://github.com/marat101/PDF-Viewer"
30-
licenses {
31-
license {
32-
name = "The Apache License, Version 2.0"
33-
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
34-
distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
35-
}
36-
}
37-
developers {
38-
developer {
39-
id.set("marat101")
40-
name.set("Marat")
41-
email.set("maratnv101@gmail.com")
42-
}
43-
}
44-
scm {
45-
url.set("https://github.com/marat101/PDF-Viewer")
46-
connection.set("scm:git:https://github.com/marat101/PDF-Viewer.git")
47-
developerConnection = "scm:git:ssh://git@github.com/marat101/PDF-Viewer.git"
48-
}
49-
}
50-
}
51-
repositories {
52-
mavenCentral {
53-
name = "MavenCentral"
54-
credentials {
55-
username = System.getenv("MAVEN_CENTRAL_USERNAME")
56-
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
57-
}
58-
}
59-
}
60-
}
61-
}
62-
63-
signing {
64-
sign(publishing.publications)
10+
id("com.vanniktech.maven.publish") version "0.31.0-rc2"
6511
}
6612

6713
android {
@@ -105,4 +51,35 @@ dependencies {
10551
implementation(libs.androidx.ui.tooling.preview)
10652
implementation(libs.androidx.material3)
10753
debugImplementation(libs.androidx.ui.tooling)
54+
}
55+
56+
mavenPublishing {
57+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
58+
59+
signAllPublications()
60+
coordinates("io.github.marat101", "pdf-viewer", "1.0.0-alpha")
61+
pom {
62+
name = "PdfViewer"
63+
description = "Android PdfViewer library"
64+
url = "https://github.com/marat101/PDF-Viewer"
65+
licenses {
66+
license {
67+
name = "The Apache License, Version 2.0"
68+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
69+
distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
70+
}
71+
}
72+
developers {
73+
developer {
74+
id.set("marat101")
75+
name.set("Marat")
76+
email.set("maratnv101@gmail.com")
77+
}
78+
}
79+
scm {
80+
url.set("https://github.com/marat101/PDF-Viewer")
81+
connection.set("scm:git:https://github.com/marat101/PDF-Viewer.git")
82+
developerConnection = "scm:git:ssh://git@github.com/marat101/PDF-Viewer.git"
83+
}
84+
}
10885
}

0 commit comments

Comments
 (0)