Skip to content

Commit

Permalink
Merge pull request #8 from veryfi/feature/pre-release
Browse files Browse the repository at this point in the history
Add publish to maven release.
  • Loading branch information
androide0917 authored Dec 20, 2021
2 parents ccd9732 + 98a4366 commit 25571ca
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Publish package
run: gradle publish
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
62 changes: 62 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,68 @@ plugins {
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'kover'
id 'maven-publish'
}

group = 'com.veryfi'
version = '1.0.0'

afterEvaluate{
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.veryfi'
artifactId = 'veryfi-android'
version = '1.0.0'
pom {
name = 'Veryfi Android'
description = 'Android kotlin module for communicating with the Veryfi OCR API'
url = 'https://github.com/veryfi/veryfi-android'
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'androide0917'
name = 'Yuber Garcia'
email = 'yubergarcia@veryfi.com'
}
developer {
id = 'kaevan89'
name = 'Sebastian Carmona'
email = 'sebastiancarmona@veryfi.com'
}
developer {
id = 'alejouribesanchez'
name = 'Alejandro Uribe'
email = 'alejandro@veryfi.com'
}
}
scm {
connection = 'scm:git:git://github.com/veryfi/veryfi-android.git'
developerConnection = 'scm:git:ssh://github.com/veryfi/veryfi-android.git'
url = 'https://github.com/veryfi/veryfi-android/'
}
}
}
}
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/releases'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
}

android {
Expand Down
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "com.android.tools.build:gradle:7.0.4"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.5.30"
classpath 'org.jetbrains.kotlinx:kover:0.4.1'
Expand Down

0 comments on commit 25571ca

Please sign in to comment.