From d3afbd1db6d545c865ec1197c2505c4fe47c4fd9 Mon Sep 17 00:00:00 2001
From: Haotian Zhang <928016560@qq.com>
Date: Wed, 28 May 2025 11:31:11 +0800
Subject: [PATCH 1/2] docs:update GitHub Action.
---
.github/workflows/release.yml | 2 +-
.github/workflows/snapshot.yml | 8 ++--
.github/workflows/testing.yml | 13 +++---
dubbo-examples/pom.xml | 13 ------
polaris-adapter-dubbo/pom.xml | 11 -----
pom.xml | 80 +++++++++++++++++++++++++++++-----
6 files changed, 82 insertions(+), 45 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cd43d5c..5a3e1d3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,7 +12,7 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
- java-version: '11'
+ java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml
index ba48ec3..a036b68 100644
--- a/.github/workflows/snapshot.yml
+++ b/.github/workflows/snapshot.yml
@@ -1,10 +1,10 @@
-# 相当于脚本用途的一个声明
name: Snapshot
-# 触发脚本的事件 这里为发布release之后触发
on:
push:
branches:
- - dubbo*
+ - dubbo-3.2.x
+ - dubbo-2.x
+ - release/*
jobs:
check-snapshot:
@@ -33,7 +33,7 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
- java-version: '11'
+ java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
index 26d14db..a104b58 100644
--- a/.github/workflows/testing.yml
+++ b/.github/workflows/testing.yml
@@ -1,12 +1,15 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
name: Testing
on:
push:
- branches: [ main ]
+ branches:
+ - dubbo-3.2.x
+ - dubbo-2.x
+ - release/*
pull_request:
- branches: [ main ]
+ branches:
+ - dubbo-3.2.x
+ - dubbo-2.x
+ - release/*
jobs:
build:
diff --git a/dubbo-examples/pom.xml b/dubbo-examples/pom.xml
index 9b6aa22..b0420b8 100644
--- a/dubbo-examples/pom.xml
+++ b/dubbo-examples/pom.xml
@@ -51,18 +51,5 @@
log4j-slf4j-impl
${log4j2.version}
-
-
- junit
- junit
- ${junit.version}
- test
-
-
-
- org.springframework
- spring-test
- test
-
\ No newline at end of file
diff --git a/polaris-adapter-dubbo/pom.xml b/polaris-adapter-dubbo/pom.xml
index 9f27c50..f4ced38 100644
--- a/polaris-adapter-dubbo/pom.xml
+++ b/polaris-adapter-dubbo/pom.xml
@@ -63,21 +63,10 @@
com.tencent.polaris
polaris-all
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
-
com.jayway.jsonpath
json-path
${json_path_version}
-
- junit
- junit
- 4.13.1
- test
-
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index c91f70d..a57693f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,10 +46,15 @@
2.7.23
- ${maven.build.timestamp}
+ 1.7.25
+ 2.8.0
+ 4.13.1
+ 1.14.19
+ 4.9.0
+ 3.16.1
+
+
yyyy-MM-dd HH:mm
- UTF-8
- UTF-8
UTF-8
1.8
1.8
@@ -59,8 +64,11 @@
3.0.1
3.0.0-M1
1.2.5
- 1.7.25
- 2.8.0
+ 3.1.0
+
+ ${maven.build.timestamp}
+ UTF-8
+ UTF-8
@@ -76,11 +84,6 @@
polaris-all
${polaris.version}
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
-
com.jayway.jsonpath
json-path
@@ -89,8 +92,63 @@
+
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.version}
+ provided
+
+
+ junit
+ junit
+ ${junit.version}
+ test
+
+
+ net.bytebuddy
+ byte-buddy
+ ${byte-buddy.version}
+ test
+
+
+ net.bytebuddy
+ byte-buddy-agent
+ ${byte-buddy.version}
+ test
+
+
+ org.mockito
+ mockito-inline
+ ${mockito.version}
+ test
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+
+
+ org.apache.maven.plugins
+ maven-clean-plugin
+ ${maven.clean.plugin.version}
+
+
+
+ ${project.basedir}
+
+ dependency-reduced-pom.xml
+
+
+
+
+
org.apache.maven.plugins
maven-checkstyle-plugin
@@ -274,4 +332,4 @@
-
\ No newline at end of file
+
From fd21dbb037b4fc0690fdcd78b7dbcb8b3bea12af Mon Sep 17 00:00:00 2001
From: Haotian Zhang <928016560@qq.com>
Date: Wed, 28 May 2025 11:52:14 +0800
Subject: [PATCH 2/2] docs:update GitHub Action.
---
.github/workflows/release.yml | 8 +++-----
.github/workflows/snapshot.yml | 31 ++++++++++++++++++++++++-------
.github/workflows/testing.yml | 33 ++++++++++++++++++++++++++++-----
3 files changed, 55 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5a3e1d3..3f34878 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,6 +1,4 @@
-# 相当于脚本用途的一个声明
name: Release
-# 触发脚本的事件 这里为发布release之后触发
on:
release:
types: [published]
@@ -8,9 +6,9 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Maven Central Repository
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
@@ -24,4 +22,4 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
run: |
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import;
- mvn clean deploy -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -DskipTests
+ mvn clean deploy -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -DskipTests -B -U
diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml
index a036b68..dc3bb2b 100644
--- a/.github/workflows/snapshot.yml
+++ b/.github/workflows/snapshot.yml
@@ -13,7 +13,7 @@ jobs:
IS_SNAPSHOT: ${{ steps.set_output_1.outputs.IS_SNAPSHOT }}
steps:
- name: Checkout codes
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Check deploy type
id: set_output_1
run: |
@@ -24,16 +24,33 @@ jobs:
else
echo "IS_SNAPSHOT=false" >> $GITHUB_OUTPUT
fi
- release:
+ set-jdk:
runs-on: ubuntu-latest
- needs: check-snapshot
+ outputs:
+ jdk: ${{ steps.set-jdk.outputs.jdk }}
+ steps:
+ - name: Set JDK based on branch
+ id: set-jdk
+ run: |
+ shopt -s nocasematch
+ if [[ "${{ github.ref_name }}" == "dubbo-3.2.x" ]]; then
+ echo "jdk=17" >> $GITHUB_OUTPUT
+ elif [[ "${{ github.ref_name }}" == "dubbo-2.x" ]]; then
+ echo "jdk=8" >> $GITHUB_OUTPUT
+ else
+ echo "jdk=8" >> $GITHUB_OUTPUT
+ fi
+ shopt -u nocasematch
+ snapshot:
+ runs-on: ubuntu-latest
+ needs: [ check-snapshot, set-jdk ]
if: ${{ needs.check-snapshot.outputs.IS_SNAPSHOT == 'true' }}
steps:
- - uses: actions/checkout@v3
- - name: Set up Maven Central Repository
- uses: actions/setup-java@v3
+ - uses: actions/checkout@v4
+ - name: Set up JDK ${{ needs.set-jdk.outputs.jdk }}
+ uses: actions/setup-java@v4
with:
- java-version: '8'
+ java-version: ${{ needs.set-jdk.outputs.jdk }}
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
index a104b58..bb44729 100644
--- a/.github/workflows/testing.yml
+++ b/.github/workflows/testing.yml
@@ -12,22 +12,45 @@ on:
- release/*
jobs:
- build:
+ set-jdks:
+ runs-on: ubuntu-latest
+ outputs:
+ jdks: ${{ steps.set-jdks.outputs.jdks }}
+ steps:
+ - name: Set JDK matrix based on branch
+ id: set-jdks
+ run: |
+ shopt -s nocasematch
+ branch_name=${{ github.ref_name }}
+ if [ -n "${{ github.base_ref }}" ]; then
+ branch_name=${{ github.base_ref }}
+ fi
+ echo $branch_name
+ if [[ "$branch_name" == "dubbo-3.2.x" ]]; then
+ echo "jdks=[8,17]" >> $GITHUB_OUTPUT
+ elif [[ "$branch_name" == "dubbo-2.x" ]]; then
+ echo "jdks=[8]" >> $GITHUB_OUTPUT
+ else
+ echo "jdks=[8]" >> $GITHUB_OUTPUT
+ fi
+ shopt -u nocasematch
+ junit:
strategy:
matrix:
- java: [ 8 ]
+ java: ${{ fromJson(needs.set-jdks.outputs.jdks) }}
os: [ 'windows-latest', 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}
+ needs: set-jdks
steps:
- name: Checkout codes
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Cache local Maven repository
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}