Skip to content

Commit

Permalink
Merge pull request #51 from boschglobal/feature-46_4
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianSchildt authored Nov 29, 2023
2 parents 74a1810 + 5b75f19 commit d6d2fce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:

- name: Publish Library
env:
ORG_GPG_KEY_ID: ${{ secrets.ORG_GPG_KEY_ID }}
ORG_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
ORG_GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
ORG_OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:

- name: Publish Library
env:
ORG_GPG_KEY_ID: ${{ secrets.ORG_GPG_KEY_ID }}
ORG_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
ORG_GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
ORG_OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
ORG_OSSRH_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
run: ./gradlew publishAllPublicationsToOSSRHSnapshotRepository
run: ./gradlew --stacktrace publishAllPublicationsToOSSRHSnapshotRepository
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,9 @@ Snapshot builds are also available (but of course less stable): [Package view](h
See the [quickstart guide](https://github.com/eclipse-kuksa/kuksa-android-sdk/tree/main/docs/QUICKSTART.md) for
additional integration options.

### GitHub packages
### Maven Central

The KUKSA SDK is currently uploaded to [GitHub packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry)
where an [authentication](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#authenticating-to-github-packages)
is needed to download the dependency.

```
maven {
url = uri("https://maven.pkg.github.com/eclipse-kuksa/kuksa-android-sdk")
credentials {
username = <USERNAME>
password = <GITHUB_TOKEN>
}
}
```
The KUKSA SDK is currently uploaded to [Maven Central](https://central.sonatype.com/search?q=org.eclipse.kuksa).

## Usage

Expand Down
19 changes: 13 additions & 6 deletions buildSrc/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ interface PublishPluginExtension {

val extension = project.extensions.create<PublishPluginExtension>("publish")

// configure GPG -> https://docs.gradle.org/current/userguide/signing_plugin.html#example_configure_the_gnupgsignatory
ext["signing.gnupg.executable"] = "gpg"
ext["signing.gnupg.keyName"] = System.getenv("ORG_GPG_PRIVATE_KEY")
ext["signing.gnupg.passphrase"] = System.getenv("ORG_GPG_PASSPHRASE")

afterEvaluate {
publishing {
repositories {
Expand Down Expand Up @@ -79,7 +74,19 @@ afterEvaluate {
}

signing {
useGpgCmd()
var keyId: String? = System.getenv("ORG_GPG_KEY_ID")
if (keyId != null && keyId.length > 8) {
keyId = keyId.takeLast(8)
}
val privateKey = System.getenv("ORG_GPG_PRIVATE_KEY")
val passphrase = System.getenv("ORG_GPG_PASSPHRASE")

useInMemoryPgpKeys(
keyId,
privateKey,
passphrase,
)

sign(publishing.publications)
}
}
Expand Down

0 comments on commit d6d2fce

Please sign in to comment.