diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7f83c7..523525f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,4 +12,4 @@ jobs: with: java-version: 1.17 - name: Build with Gradle - run: ./gradlew build + run: ./gradlew build -x signArchives -x uploadArchives diff --git a/build.gradle b/build.gradle index eef09dd..b34c03e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,14 +7,15 @@ buildscript { plugins { id 'java' + id 'signing' id 'maven-publish' - id "com.jfrog.bintray" version "1.8.5" id 'com.adarshr.test-logger' version '3.0.0' id 'org.jetbrains.kotlin.jvm' version '1.5.31' } -group 'com.viartemev' -version '1.2.2' +group = 'com.viartemev' +version = '1.3.0' +archivesBaseName = "ktor-flyway-feature" sourceCompatibility = 1.8 @@ -47,7 +48,7 @@ compileTestKotlin { jar { archiveBaseName = "ktor-flyway-feature" - archiveVersion = "1.2.2" + archiveVersion = "1.3.0" } test { @@ -59,62 +60,63 @@ task sourcesJar(type: Jar, dependsOn: classes) { from sourceSets.main.allSource } +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} + artifacts { archives jar archives sourcesJar + archives javadocJar } -publishing { - publications { - mavenJava(MavenPublication) { - artifact(sourcesJar) { - classifier = 'sources' +signing { + useGpgCmd() + sign configurations.archives +} + +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) } - pom { - groupId = 'com.viartemev' - artifactId = 'ktor-flyway-feature' - from components.kotlin + snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name 'Ktor Flyway feature' + packaging 'jar' + // optionally artifactId can be defined here + description 'Ktor flyway feature' + url 'https://github.com/viartemev/ktor-flyway-feature' + + scm { + connection 'scm:git:git://github.com/viartemev/ktor-flyway-feature.git' + developerConnection 'scm:git:ssh://github.com/viartemev/ktor-flyway-feature.git' + url 'https://github.com/viartemev/ktor-flyway-feature' + } - name = 'Ktor Flyway feature' - description = 'Ktor flyway feature' - url = 'https://github.com/viartemev/ktor-flyway-feature' licenses { license { - name = 'MIT' - url = 'https://raw.githubusercontent.com/viartemev/ktor-flyway-feature/master/LICENSE' + name 'MIT' + url 'https://raw.githubusercontent.com/viartemev/ktor-flyway-feature/master/LICENSE' } } + developers { developer { - id = 'viartemev' - name = 'Vyacheslav Artemyev' - email = 'viartemev@gmail.com' + id 'viartemev' + name 'Vyacheslav Artemyev' + email 'viartemev@gmail.com' } } - scm { - connection = 'scm:git:git://github.com/viartemev/ktor-flyway-feature.git' - developerConnection = 'scm:git:ssh://github.com/viartemev/ktor-flyway-feature.git' - url = 'https://github.com/viartemev/ktor-flyway-feature' - } } } } -} - -bintray { - user = System.getenv('BINTRAY_USER') - key = System.getenv('BINTRAY_KEY') - publications = ['mavenJava'] - pkg { - userOrg = 'viartemev' - repo = 'Maven' - name = 'ktor-flyway-feature' - licenses = ['MIT'] - desc = 'Ktor flyway feature' - websiteUrl = 'https://github.com/viartemev/ktor-flyway-feature' - issueTrackerUrl = 'https://github.com/viartemev/ktor-flyway-feature/issues' - vcsUrl = 'https://github.com/viartemev/ktor-flyway-feature.git' - publicDownloadNumbers = true - } -} +} \ No newline at end of file