Skip to content

Commit

Permalink
Added publish.yml workflow 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Zakaryan committed Nov 6, 2024
1 parent 48f1fe8 commit 4fb5346
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
cmdline-tools-version: 8512546
packages: 'build-tools;22.0.1 platforms;android-22'

- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r10e

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

Expand All @@ -33,4 +38,4 @@ jobs:
SIMLA_MOBILE_APPS_EMAIL: ${{ secrets.SIMLA_MOBILE_APPS_EMAIL }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew :opuslib:publishReleasePublicationToMainRepository --stacktrace
run: ./gradlew :opuslib:uploadArchives --stacktrace
48 changes: 48 additions & 0 deletions gradle/gradle-maven.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apply plugin: 'maven'
apply plugin: 'signing'

uploadArchives {
repositories {
mavenDeployer {
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_PASSWORD"))
}

beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.project {
name 'OpusLib'
description 'Re-publishing of OpusLib with no additional functionality.'
url 'https://github.com/simla-tech/opus_android'

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

developers {
developer {
id 'SimlaTech'
name 'Simla Mobile Dev Team'
email System.getenv("SIMLA_TECH_EMAIL")
}
}

scm {
url 'https://github.com/simla-tech/opus_android'
connection 'scm:git:git://github.com/simla-tech/opus_android.git'
developerConnection 'scm:git:ssh://github.com/simla-tech/opus_android.git'
}
}
}
}
}

// Configure signing for all artifacts in 'archives' configuration
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
2 changes: 1 addition & 1 deletion gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ signing {
//def signingKey = findProperty("signingKey") ?: System.getenv("SIGNING_KEY")
//def signingPassword = findProperty("signingKeyPassword") ?: System.getenv("SIGNING_KEY_PASSWORD")
//useInMemoryPgpKeys(/*signingKeyId,*/ signingKey, signingPassword)
sign publishReleasePublicationToMainRepository
sign
}
9 changes: 5 additions & 4 deletions opuslib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ apply plugin: 'com.android.library'
//apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.jfrog.bintray'

group = 'com.simla.android.opuslib'
version = "1.0.2"

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
Expand Down Expand Up @@ -124,19 +126,18 @@ bintray {
}
// */

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
//apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
apply from: rootProject.file('gradle/gradle-maven.gradle')

gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {

def id = "42AAF42A"
def file = project.file('.gpg/SimlaTechSigning.gpg').absolutePath
def file = project.file('../.gpg/SimlaTechSigning.gpg').absolutePath
def password = "retailcrm"

allprojects { ext."signing.keyId" = id }
allprojects { ext."signing.secretKeyRingFile" = file }
allprojects { ext."signing.password" = password }

console.printf "\nThanks.\n\n"
}
}

0 comments on commit 4fb5346

Please sign in to comment.