Skip to content

docs:update GitHub Action. #80

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

Merged
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
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# 相当于脚本用途的一个声明
name: Release
# 触发脚本的事件 这里为发布release之后触发
on:
release:
types: [published]
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: '11'
java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
Expand All @@ -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
37 changes: 27 additions & 10 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 相当于脚本用途的一个声明
name: Snapshot
# 触发脚本的事件 这里为发布release之后触发
on:
push:
branches:
- dubbo*
- dubbo-3.2.x
- dubbo-2.x
- release/*

jobs:
check-snapshot:
Expand All @@ -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: |
Expand All @@ -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: '11'
java-version: ${{ needs.set-jdk.outputs.jdk }}
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
Expand Down
46 changes: 36 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,56 @@
# 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:
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') }}
Expand Down
13 changes: 0 additions & 13 deletions dubbo-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,5 @@
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
11 changes: 0 additions & 11 deletions polaris-adapter-dubbo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,10 @@
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-all</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json_path_version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
80 changes: 69 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@
<!-- Apache Dubbo version -->
<apache.dubbo.version>2.7.23</apache.dubbo.version>

<timestamp>${maven.build.timestamp}</timestamp>
<slf4j.version>1.7.25</slf4j.version>
<json_path_version>2.8.0</json_path_version>
<junit.version>4.13.1</junit.version>
<byte-buddy.version>1.14.19</byte-buddy.version>
<mockito.version>4.9.0</mockito.version>
<assertj.version>3.16.1</assertj.version>

<!-- Maven Plugin -->
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -59,8 +64,11 @@
<maven.gpg.plugin.version>3.0.1</maven.gpg.plugin.version>
<maven.deploy.plugin.version>3.0.0-M1</maven.deploy.plugin.version>
<maven.flatten.plugin.version>1.2.5</maven.flatten.plugin.version>
<slf4j.version>1.7.25</slf4j.version>
<json_path_version>2.8.0</json_path_version>
<maven.clean.plugin.version>3.1.0</maven.clean.plugin.version>

<timestamp>${maven.build.timestamp}</timestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencyManagement>
Expand All @@ -76,11 +84,6 @@
<artifactId>polaris-all</artifactId>
<version>${polaris.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
Expand All @@ -89,8 +92,63 @@
</dependencies>
</dependencyManagement>

<dependencies>
<!--日志相关依赖-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.plugin.version}</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}</directory>
<includes>
<include>dependency-reduced-pom.xml</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down Expand Up @@ -274,4 +332,4 @@
</snapshots>
</repository>
</repositories>
</project>
</project>