Skip to content

Commit 4cfd7b0

Browse files
committed
chore: update build.gradle.kts
1 parent d63c7f2 commit 4cfd7b0

5 files changed

Lines changed: 42 additions & 32 deletions

File tree

.github/workflows/publish-maven.yml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ name: Publish to Maven Central
33
on:
44
push:
55
branches:
6-
- publish # 推送到 publish 分支时触发 snapshot 发布
6+
- publish # 推送到 publish 分支时触发 snapshot 发布
77
tags:
8-
- "v*" # 推送 tag(如 v0.1.0)时触发正式发布
8+
- 'v*' # 推送 tag(如 v0.1.0)时触发正式发布
99

1010
jobs:
1111
publish:
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- name: Set up JDK 17
2121
uses: actions/setup-java@v4
2222
with:
23-
java-version: "17"
24-
distribution: "temurin"
25-
23+
java-version: '17'
24+
distribution: 'temurin'
25+
2626
- name: Setup Android SDK
2727
uses: android-actions/setup-android@v3
28-
28+
2929
- name: Cache Gradle packages
3030
uses: actions/cache@v4
3131
with:
@@ -38,20 +38,23 @@ jobs:
3838
3939
- name: Import GPG Key
4040
env:
41-
GPG_KEY_CONTENT: ${{ secrets.GPG_PRIVATE_KEY }}
41+
GPG_KEY_CONTENT: ${{ secrets.GPG_PRIVATE_KEY }}
4242
run: |
43-
echo "$GPG_KEY_CONTENT" | base64 -d | gpg --batch --import
44-
gpg --list-secret-keys --keyid-format LONG
45-
43+
echo "$GPG_KEY_CONTENT" | base64 -d | gpg --batch --import
44+
gpg --list-secret-keys --keyid-format LONG
45+
4646
- name: Grant execute permission for gradlew
4747
run: chmod +x gradlew
48-
48+
4949
- name: Build project
5050
run: ./gradlew clean assembleRelease --stacktrace
51-
51+
5252
- name: Run tests
5353
run: ./gradlew clean testReleaseUnitTest --stacktrace
5454

55+
- name: Stop Gradle Daemon
56+
run: ./gradlew --stop
57+
5558
- name: Publish to Maven Central
5659
env:
5760
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
@@ -67,12 +70,12 @@ jobs:
6770
echo "📦 Publishing snapshot version (from branch: ${{ github.ref_name }})"
6871
VERSION_TYPE="snapshot"
6972
fi
70-
73+
7174
# Publish all modules
72-
./gradlew publish --no-daemon --stacktrace
73-
75+
./gradlew publish --no-daemon --stacktrace -Pdd-skip-signing=false
76+
7477
echo "✅ Publishing completed"
75-
78+
7679
- name: Notify on success
7780
if: success()
7881
run: |
@@ -84,7 +87,7 @@ jobs:
8487
echo "✅ Published snapshot from ${{ github.ref_name }} branch"
8588
echo "📍 Snapshot repository: https://s01.oss.sonatype.org/content/repositories/snapshots/"
8689
fi
87-
90+
8891
- name: Notify on failure
8992
if: failure()
9093
run: |
@@ -93,3 +96,4 @@ jobs:
9396
echo " - GPG key not properly configured"
9497
echo " - Maven Central credentials incorrect"
9598
echo " - Build or test failures"
99+

.idea/copyright/Datadog.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.idea/copyright/profiles_settings.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ allprojects {
6262
val mavenCentralUsername = System.getenv("MAVEN_CENTRAL_USERNAME")
6363
val mavenCentralPassword = System.getenv("MAVEN_CENTRAL_PASSWORD")
6464

65+
val signingKeyEnv = System.getenv("GPG_PRIVATE_KEY")
66+
val signingPassword = System.getenv("GPG_PASSWORD")
67+
6568
// Configure snapshot repository for all subprojects
6669
subprojects {
6770
plugins.withId("maven-publish") {
@@ -77,6 +80,21 @@ subprojects {
7780
}
7881
}
7982
}
83+
84+
if (!signingKeyEnv.isNullOrEmpty()) {
85+
apply(plugin = "signing")
86+
configure<SigningExtension> {
87+
try {
88+
val decodedKey = String(java.util.Base64.getDecoder().decode(signingKeyEnv))
89+
useInMemoryPgpKeys(decodedKey, signingPassword)
90+
} catch (e: Exception) {
91+
// 如果不是 Base64,尝试直接使用(防止你存的是纯文本)
92+
useInMemoryPgpKeys(signingKeyEnv, signingPassword)
93+
}
94+
95+
sign(extensions.getByType<PublishingExtension>().publications)
96+
}
97+
}
8098
}
8199
}
82100

features/dd-sdk-android-rum/src/test/kotlin/cloud/flashcat/android/rum/internal/anr/AndroidTraceParserTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ internal class AndroidTraceParserTest {
115115
const val MAIN_THREAD_STACK =
116116
""" at android.graphics.Paint.getNativeInstance(Paint.java:743)
117117
at android.graphics.BaseRecordingCanvas.drawRect(BaseRecordingCanvas.java:364)
118-
at cloud.flashcat.android.sample.vitals.BadView.onDraw(BadView.kt:72)
118+
at com.flashcat.android.sample.vitals.BadView.onDraw(BadView.kt:72)
119119
at android.view.View.draw(View.java:23889)
120120
at android.view.View.updateDisplayListIfDirty(View.java:22756)
121121
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540)

0 commit comments

Comments
 (0)