Skip to content

Commit

Permalink
Merge pull request #33 from play-iot/release/0.0.1
Browse files Browse the repository at this point in the history
Correct build release ci workflow
  • Loading branch information
zero88 authored Jun 8, 2023
2 parents 87c97d3 + c4a9d94 commit 3e85003
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ jobs:
java-version: 11
cache: 'gradle'

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
git_user_signingkey: true
gpg_private_key: ${{ secrets.OSS_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.OSS_GPG_PASSPHARSE }}

- name: Publish GitHub Package
if: env.ENABLE_GH_MAVEN == 'true'
run: |
Expand Down
52 changes: 24 additions & 28 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,30 @@ publishing {
fromResolutionResult()
}
}
pom {
name.set(prop(project, "title"))
description.set(prop(project, "description"))
url.set("https://github.com/play-iot/gradle-plugin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/play-iot/gradle-plugin/blob/main/LICENSE")
}

afterEvaluate {
withType<MavenPublication> {
pom {
name.set(prop(project, "title"))
description.set(prop(project, "description"))
url.set("https://github.com/play-iot/gradle-plugin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/play-iot/gradle-plugin/blob/main/LICENSE")
}
}
}
developers {
developer {
id.set("zero88")
email.set("[email protected]")
developers {
developer {
id.set("zero88")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://[email protected]:play-iot/gradle-plugin.git")
url.set("https://github.com/play-iot/gradle-plugin")
}
}
scm {
connection.set("scm:git:git://[email protected]:play-iot/gradle-plugin.git")
url.set("https://github.com/play-iot/gradle-plugin")
}
}
}
Expand Down Expand Up @@ -218,19 +223,10 @@ nexusPublishing {
packageGroup.set("cloud.playio")
repositories {
sonatype {
val (releaseUrl, snapshotUrl) = getRepositoryUrl()
nexusUrl.set(uri(releaseUrl))
snapshotRepositoryUrl.set(uri(snapshotUrl))
nexusUrl.set(uri(prop(project, "ossrh.release.url")))
snapshotRepositoryUrl.set(uri(prop(project, "ossrh.snapshot.url")))
username.set(project.property("nexus.username") as String?)
password.set(project.property("nexus.password") as String?)
}
}
}

fun getRepositoryUrl(): Pair<String, String> {
if (project.hasProperty("github")) {
val path = "${project.property("github.nexus.url")}/${project.property("nexus.username")}/${rootProject.name}"
return Pair(path, path)
}
return Pair(prop(project, "ossrh.release.url"), prop(project, "ossrh.snapshot.url"))
}

0 comments on commit 3e85003

Please sign in to comment.