mirror of
https://github.com/fankes/unmeta-gradle-plugin.git
synced 2025-09-05 10:35:16 +08:00
Introduce signing with PGP key
This commit is contained in:
2
.github/workflows/pre-merge.yaml
vendored
2
.github/workflows/pre-merge.yaml
vendored
@@ -17,6 +17,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
||||||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
||||||
|
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
|
||||||
|
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
|
||||||
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
|
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
|
2
.github/workflows/publish-plugin.yaml
vendored
2
.github/workflows/publish-plugin.yaml
vendored
@@ -11,6 +11,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
||||||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
||||||
|
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
|
||||||
|
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
|
||||||
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
|
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
signing
|
||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
`java-gradle-plugin`
|
`java-gradle-plugin`
|
||||||
alias(libs.plugins.pluginPublish)
|
alias(libs.plugins.pluginPublish)
|
||||||
@@ -21,6 +22,13 @@ java {
|
|||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
val signingKey = System.getenv("GPG_SIGNING_KEY")
|
||||||
|
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")
|
||||||
|
useInMemoryPgpKeys(signingKey.chunked(64).joinToString("\n"), signingPassword)
|
||||||
|
sign(tasks["jar"])
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||||
|
Reference in New Issue
Block a user