Skip to content

Commit baebb59

Browse files
authored
Publish new (#6)
* feat: change group id * feat: update maven plugin * feat: flashcat site * chore: configure SDK v0.3.0 release settings - Exclude logs, flags, session-replay modules from publishing - Update version to 0.3.0 with dynamic versioning from git tags - Add JVM --add-opens for java.lang.invoke to fix JDK 17+ reflection - Comment out excluded module dependencies in samples and integration tests - Exclude sample projects from build (depend on removed features) * feat: add ding notify * chore: update GitHub Actions trigger branch to publish Update workflows to trigger on the publish branch instead of publish-new: - publish-maven.yml: Change publish trigger branch - codeql-analysis.yml: Change push and pull request target branches
1 parent 5b2e38f commit baebb59

81 files changed

Lines changed: 735 additions & 743 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/changelog-to-confluence.yaml

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

.github/workflows/codeql-analysis.yml

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "**" ]
5+
branches: ["publish"]
66
pull_request:
77
# The branches below must be a subset of the branches above
8-
branches: [ "master", "develop", "release/**", "feature/**" ]
8+
branches: ["publish"]
99

1010
jobs:
1111
analyze:
@@ -19,44 +19,46 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
language: [ 'java' ]
22+
language: ["java"]
2323
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
2424
# Use only 'java' to analyze code written in Java, Kotlin or both
2525
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
2626

2727
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30-
31-
- name: Setup Java 17
32-
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
33-
with:
34-
distribution: 'zulu'
35-
java-version: 17
36-
37-
# Initializes the CodeQL tools for scanning.
38-
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
40-
with:
41-
languages: ${{ matrix.language }}
42-
# If you wish to specify custom queries, you can do so here or in a config file.
43-
# By default, queries listed here will override any specified in a config file.
44-
# Prefix the list here with "+" to use these queries and those in the config file.
45-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
46-
# queries: security-extended,security-and-quality
47-
48-
49-
- name: Setup Gradle
50-
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
51-
with:
52-
gradle-version: 8.14.3
53-
54-
# Manually build the java bytecode
55-
- name: Execute Gradle build
56-
run: ./gradlew assembleLibrariesRelease
57-
58-
# Perform the analysis
59-
- name: Perform CodeQL Analysis
60-
uses: github/codeql-action/analyze@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
61-
with:
62-
category: "/language:${{matrix.language}}"
28+
- name: Checkout repository
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
31+
- name: Setup Java 17
32+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
33+
with:
34+
distribution: "zulu"
35+
java-version: 17
36+
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
40+
with:
41+
languages: ${{ matrix.language }}
42+
# If you wish to specify custom queries, you can do so here or in a config file.
43+
# By default, queries listed here will override any specified in a config file.
44+
# Prefix the list here with "+" to use these queries and those in the config file.
45+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
46+
# queries: security-extended,security-and-quality
47+
48+
- name: Setup Gradle
49+
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
50+
with:
51+
gradle-version: 8.14.3
52+
53+
# Manually build the java bytecode
54+
- name: Execute Gradle build
55+
run: ./gradlew assembleLibrariesRelease
56+
57+
- name: Stop Gradle Daemon
58+
run: ./gradlew --stop
59+
60+
# Perform the analysis
61+
- name: Perform CodeQL Analysis
62+
uses: github/codeql-action/analyze@f47c8e6a9bd05ef3ee422fc8d8663be7fe4bdc61 # v3.31.9
63+
with:
64+
category: "/language:${{matrix.language}}"
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Publish to Maven Central
2+
3+
on:
4+
push:
5+
branches:
6+
- publish # 推送到 publish 分支时触发 snapshot 发布
7+
tags:
8+
- "v*" # 推送 tag(如 v0.1.0)时触发正式发布
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: "17"
24+
distribution: "temurin"
25+
26+
- name: Setup Android SDK
27+
uses: android-actions/setup-android@v3
28+
29+
- name: Cache Gradle packages
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.gradle/caches
34+
~/.gradle/wrapper
35+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
36+
restore-keys: |
37+
${{ runner.os }}-gradle-
38+
39+
- name: Grant execute permission for gradlew
40+
run: chmod +x gradlew
41+
42+
- name: Build project
43+
run: ./gradlew clean assembleRelease --stacktrace
44+
45+
- name: Run tests
46+
run: ./gradlew testReleaseUnitTest --stacktrace
47+
48+
- name: Stop Gradle Daemon
49+
run: ./gradlew --stop
50+
51+
- name: Publish to Maven Central
52+
env:
53+
# Maven Central Portal credentials
54+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
55+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
56+
# GPG signing credentials (supports both base64 and ASCII armored)
57+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
58+
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }}
59+
run: |
60+
# Determine if this is a snapshot or release build
61+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
62+
echo "📦 Publishing release version (from tag: ${{ github.ref_name }})"
63+
VERSION_TYPE="release"
64+
else
65+
echo "📦 Publishing snapshot version (from branch: ${{ github.ref_name }})"
66+
VERSION_TYPE="snapshot"
67+
fi
68+
69+
# Publish all modules using Vanniktech plugin
70+
# This will upload to Maven Central Portal
71+
./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --stacktrace
72+
73+
echo "✅ Publishing completed"
74+
75+
notify-success:
76+
needs: publish
77+
runs-on: ubuntu-latest
78+
if: success()
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@v4
82+
83+
- name: Determine version type
84+
id: version
85+
run: |
86+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
87+
echo "type=正式版" >> $GITHUB_OUTPUT
88+
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
89+
else
90+
echo "type=快照版" >> $GITHUB_OUTPUT
91+
echo "version=${{ github.ref_name }}-SNAPSHOT" >> $GITHUB_OUTPUT
92+
fi
93+
94+
- name: Notify deployment success
95+
uses: zcong1993/actions-ding@master
96+
with:
97+
dingToken: ${{ secrets.DING_TALK_TOKEN }}
98+
secret: ${{ secrets.DING_TALK_SECRET }}
99+
body: |
100+
{
101+
"msgtype": "markdown",
102+
"markdown": {
103+
"title": "fc-sdk-android 发布通知",
104+
"text": "### ✅ fc-sdk-android 发布成功\n\n---\n\n 🔖 版本: ${{ steps.version.outputs.version }}\n\n 📦 类型: ${{ steps.version.outputs.type }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
105+
}
106+
}
107+
108+
notify-failure:
109+
needs: publish
110+
runs-on: ubuntu-latest
111+
if: failure()
112+
steps:
113+
- name: Checkout code
114+
uses: actions/checkout@v4
115+
116+
- name: Determine version type
117+
id: version
118+
run: |
119+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
120+
echo "type=正式版" >> $GITHUB_OUTPUT
121+
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
122+
else
123+
echo "type=快照版" >> $GITHUB_OUTPUT
124+
echo "version=${{ github.ref_name }}-SNAPSHOT" >> $GITHUB_OUTPUT
125+
fi
126+
127+
- name: Notify deployment failure
128+
uses: zcong1993/actions-ding@master
129+
with:
130+
dingToken: ${{ secrets.DING_TALK_TOKEN }}
131+
secret: ${{ secrets.DING_TALK_SECRET }}
132+
body: |
133+
{
134+
"msgtype": "markdown",
135+
"markdown": {
136+
"title": "fc-sdk-android 发布通知",
137+
"text": "### ❌ fc-sdk-android 发布失败\n\n---\n\n 🔖 版本: ${{ steps.version.outputs.version }}\n\n 📦 类型: ${{ steps.version.outputs.type }}\n\n 👨‍💻 发布者: ${{ github.actor }}\n\n 🚀 [查看详情](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
138+
}
139+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ sdk_classpath
3535
detekt_classpath
3636
**/verification-metadata.xml
3737
!gradle/verification-metadata.xml
38+
39+
local-docs/
40+
openspec/

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* [FEATURE] Feature flags context management. See [#2886](https://github.com/DataDog/dd-sdk-android/pull/2886)
7474
* [FEATURE] Feature flags: Send exposures as batches. See [#2895](https://github.com/DataDog/dd-sdk-android/pull/2895)
7575
* [FEATURE] Feature flags: Add a persistence layer. See [#2898](https://github.com/DataDog/dd-sdk-android/pull/2898)
76-
* [FEATURE] Feature flags: `DatadogSite` extension for Flags endpoint. See [#2922](https://github.com/DataDog/dd-sdk-android/pull/2922)
76+
* [FEATURE] Feature flags: `FlashcatSite` extension for Flags endpoint.
7777
* [FEATURE] Feature flags: `Flags.enable` and `FlagsClient` APIs. See [#2900](https://github.com/DataDog/dd-sdk-android/pull/2900)
7878
* [FEATURE] Feature flags: Support custom endpoints for exposures. See [#2942](https://github.com/DataDog/dd-sdk-android/pull/2942)
7979
* [FEATURE] Feature flags: Custom flagging endpoint and assignment download refactoring. See [#2917](https://github.com/DataDog/dd-sdk-android/pull/2917)
@@ -792,7 +792,7 @@ This is the first official production version of SDK v3 containing the new archi
792792
* [IMPROVEMENT] Synchronize SR info with webviews. See [#1990](https://github.com/DataDog/dd-sdk-android/pull/1990)
793793
* [IMPROVEMENT] Core: Start sending batches immediately after feature is initialized. See [#1991](https://github.com/DataDog/dd-sdk-android/pull/1991)
794794
* [IMRPOVEMENT] Create RUM Feature Integration Tests. See [#2004](https://github.com/DataDog/dd-sdk-android/pull/2004)
795-
* [IMRROVEMENT] Make constructors of `DatadogSite` private. See [#2010](https://github.com/DataDog/dd-sdk-android/pull/2010)
795+
* [IMRROVEMENT] Make constructors of `FlashcatSite` private.
796796
* [IMRROVEMENT] Log warning about tag modification only once. See [#2017](https://github.com/DataDog/dd-sdk-android/pull/2017)
797797
* [IMRROVEMENT] Add status code in user-facing message in case of `UnknownError` during batch upload. See [#2018](https://github.com/DataDog/dd-sdk-android/pull/2018)
798798
* [MAINTENANCE] Next dev iteration. See [#1972](https://github.com/DataDog/dd-sdk-android/pull/1972)

MIGRATION.MD

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Trace.enable(
4040
1. Add the `OpenTelemetry` dependency to your `build.gradle.kts`:
4141

4242
```kotlin
43-
implementation(project("com.datadoghq:dd-sdk-android-trace-otel:x.x.x"))
43+
implementation(project("cloud.flashcat:dd-sdk-android-trace-otel:x.x.x"))
4444
```
4545

4646
2. Replace the `OpenTracing` configuration:
@@ -153,7 +153,7 @@ Replacement hints:
153153

154154
### OkHttp instrumentation changes
155155

156-
The OkHttp instrumentation (`com.datadoghq:dd-sdk-android-okhttp:x.x.x`) doesn't require desugaring support. However few migration actions may be necessary.
156+
The OkHttp instrumentation (`cloud.flashcat:dd-sdk-android-okhttp:x.x.x`) doesn't require desugaring support. However few migration actions may be necessary.
157157

158158
The default sample rate for the `traceSampler` got increased to 100% with the Android SDK version `3.0.0`.
159159

@@ -250,17 +250,17 @@ The main changes introduced in SDK 2.0 compared to 1.x are:
250250

251251
1. All relevant products (RUM, Trace, Logs, etc.) are now extracted into different modules. That allows you to integrate only what is needed into your application.
252252

253-
Whereas all products in version 1.x were contained in the single artifact `com.datadoghq:dd-sdk-android:x.x.x`, you now need to adopt the following artifacts:
253+
Whereas all products in version 1.x were contained in the single artifact `cloud.flashcat:dd-sdk-android:x.x.x`, you now need to adopt the following artifacts:
254254

255-
* RUM: `com.datadoghq:dd-sdk-android-rum:x.x.x`
256-
* Logs: `com.datadoghq:dd-sdk-android-logs:x.x.x`
257-
* Trace: `com.datadoghq:dd-sdk-android-trace:x.x.x`
258-
* WebView Tracking: `com.datadoghq:dd-sdk-android-webview:x.x.x`
259-
* OkHttp instrumentation: `com.datadoghq:dd-sdk-android-okhttp:x.x.x`
255+
* RUM: `cloud.flashcat:dd-sdk-android-rum:x.x.x`
256+
* Logs: `cloud.flashcat:dd-sdk-android-logs:x.x.x`
257+
* Trace: `cloud.flashcat:dd-sdk-android-trace:x.x.x`
258+
* WebView Tracking: `cloud.flashcat:dd-sdk-android-webview:x.x.x`
259+
* OkHttp instrumentation: `cloud.flashcat:dd-sdk-android-okhttp:x.x.x`
260260

261261
**Note**: If you utilize NDK Crash Reporting and WebView Tracking, you also need to add RUM and/or Logs artifacts to be able to report events to RUM and/or Logs respectively.
262262

263-
Reference to the `com.datadoghq:dd-sdk-android` artifact should be removed from your Gradle buildscript, this artifact doesn't exist anymore.
263+
Reference to the `cloud.flashcat:dd-sdk-android` artifact should be removed from your Gradle buildscript, this artifact doesn't exist anymore.
264264

265265
**Note**: The Maven coordinates of all the other artifacts stay the same.
266266

@@ -316,7 +316,7 @@ All the classes related to the Logs product are now strictly contained in the `c
316316
To use Logs product, import the following artifact:
317317

318318
```kotlin
319-
implementation("com.datadoghq:dd-sdk-android-logs:x.x.x")
319+
implementation("cloud.flashcat:dd-sdk-android-logs:x.x.x")
320320
```
321321

322322
You can enable the Logs product with the following snippet:
@@ -352,7 +352,7 @@ All the classes related to the Trace product are now strictly contained in the `
352352
To use the Trace product, import the following artifact:
353353

354354
```kotlin
355-
implementation("com.datadoghq:dd-sdk-android-trace:x.x.x")
355+
implementation("cloud.flashcat:dd-sdk-android-trace:x.x.x")
356356
```
357357

358358
Enable the Trace product with the following snippet:
@@ -387,7 +387,7 @@ All classes related to the RUM product are now strictly contained in the `com.da
387387
To use the RUM product, import the following artifact:
388388

389389
```kotlin
390-
implementation("com.datadoghq:dd-sdk-android-rum:x.x.x")
390+
implementation("cloud.flashcat:dd-sdk-android-rum:x.x.x")
391391
```
392392

393393
The RUM product can be enabled with the following snippet:
@@ -429,7 +429,7 @@ API changes:
429429

430430
### NDK Crash Reporting changes
431431

432-
The artifact name stays the same as before: `com.datadoghq:dd-sdk-android-ndk:x.x.x`
432+
The artifact name stays the same as before: `cloud.flashcat:dd-sdk-android-ndk:x.x.x`
433433

434434
NDK Crash Reporting can be enabled using the following snippet:
435435

@@ -443,7 +443,7 @@ This configuration replaces the `com.datadog.android.core.configuration.Configur
443443

444444
### WebView Tracking changes
445445

446-
The artifact name stays the same as before: `com.datadoghq:dd-sdk-android-webview:x.x.x`
446+
The artifact name stays the same as before: `cloud.flashcat:dd-sdk-android-webview:x.x.x`
447447

448448
You can enable WebView Tracking with the following snippet:
449449

@@ -466,7 +466,7 @@ API changes:
466466
In order to be able to use OkHttp Tracking you need to import the following artifact:
467467

468468
```kotlin
469-
implementation("com.datadoghq:dd-sdk-android-okhttp:x.x.x")
469+
implementation("cloud.flashcat:dd-sdk-android-okhttp:x.x.x")
470470
```
471471

472472
OkHttp instrumentation now supports the case when Datadog SDK is initialized after the OkHttp client, allowing you to create `com.datadog.android.okhttp.DatadogEventListener`, `com.datadog.android.okhttp.DatadogInterceptor`, and `com.datadog.android.okhttp.trace.TracingInterceptor` before Datadog SDK. OkHttp instrumentation starts reporting events to Datadog once Datadog SDK is initialized.

0 commit comments

Comments
 (0)