Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Refactor dependency-submission #194

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ 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/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- uses: gradle/actions/setup-gradle@v3
- name: Publish
run: ./gradlew -Pversion=$version -Dorg.gradle.parallel=false --no-configuration-cache publish closeAndReleaseStagingRepository
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ jobs:
build:
runs-on: macos-14
permissions:
contents: write
contents: read
security-events: write

steps:
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v3
with:
dependency-graph: generate-and-submit
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: ./gradlew build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/configure-pages@v4
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/configure-pages@v4
- uses: gradle/actions/setup-gradle@v3
- name: Generate Docs
run: ./gradlew dokkaHtmlMultiModule --no-configuration-cache
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependency review for pull requests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

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

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
with:
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}

dependency-review:
runs-on: ubuntu-latest
needs: dependency-submission
if: github.event_name == 'pull_request'
steps:
- name: Perform dependency review
uses: actions/dependency-review-action@v4
9 changes: 5 additions & 4 deletions gradle/build-logic/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ publishing {
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey?.let { String(java.util.Base64.getDecoder().decode(it)).trim() }, signingPassword)
sign(publishing.publications)
val signingKey = providers.gradleProperty("signingKey")
if (signingKey.isPresent) {
useInMemoryPgpKeys(signingKey.get(), providers.gradleProperty("signingPassword").get())
sign(publishing.publications)
}
}

// https://youtrack.jetbrains.com/issue/KT-46466
Expand Down
Loading