Skip to content

Commit

Permalink
Test signing (#12)
Browse files Browse the repository at this point in the history
* Test signing

* Test signing

---------

Co-authored-by: hfhbd <[email protected]>
  • Loading branch information
hfhbd and hfhbd authored Feb 25, 2024
1 parent bc29378 commit 495e71b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ on:
pull_request:
branches: [ main ]


jobs:
dependency-submission:
runs-on: ubuntu-latest

permissions:
contents: write

env:
GRADLE_OPTS: -Dorg.gradle.caching=true

steps:
- uses: actions/checkout@v4
- uses: gradle/actions/dependency-submission@v3
with:
additional-arguments: -Dorg.gradle.unsafe.isolated-projects=false
- uses: actions/checkout@v4
- uses: gradle/actions/dependency-submission@v3
with:
additional-arguments: -Dorg.gradle.unsafe.isolated-projects=false
cache-encryption-key: ${{ secrets.CC }}

dependency-review:
runs-on: ubuntu-latest
needs: dependency-submission
if: github.event_name == 'pull_request'

steps:
- uses: actions/dependency-review-action@v4
- uses: actions/dependency-review-action@v4
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ jobs:
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
cache-encryption-key: ${{ secrets.CC }}
- name: Build with Gradle
run: ./gradlew build
14 changes: 2 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
packages: write

env:
Expand All @@ -28,20 +26,12 @@ jobs:
- name: Set environment for version
run: long="${{ github.ref }}"; version=${long#"refs/tags/v"}; echo "version=${version}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- uses: gradle/actions/setup-gradle@v3

- name: Release maven artifacts
run: ./gradlew -Pversion=$version publish
env:
ORG_GRADLE_PROJECT_GitHubPackagesUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_GitHubPackagesPassword: ${{ github.token }}

- name: Create docs
run: ./gradlew dokkaHtmlMultiModule --no-configuration-cache
- uses: actions/upload-pages-artifact@v3
with:
path: build/dokka/htmlMultiModule
- name: Deploy Documentation to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ org.gradle.jvmargs=-Xmx2048m
org.gradle.configuration-cache=true
org.gradle.configureondemand=true
org.gradle.unsafe.isolated-projects=true
org.gradle.configuration-cache.problems=warn
group=io.github.hfhbd
version=1.0.0
20 changes: 20 additions & 0 deletions gradle/build-logic/src/main/kotlin/setup.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
kotlin("jvm")
id("maven-publish")
id("signing")
}

kotlin.jvmToolchain(8)
Expand All @@ -20,3 +21,22 @@ publishing {
from(components["java"])
}
}

java {
withJavadocJar()
withSourcesJar()
}

signing {
val signingKey: String? = project.properties["signingKey"] as String?
val signingPassword: String? = project.properties["signingPassword"] as String?
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}
}

tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}

0 comments on commit 495e71b

Please sign in to comment.