Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes committed Aug 15, 2023
2 parents 8aa02ea + 8746aef commit 41d1de1
Show file tree
Hide file tree
Showing 1,247 changed files with 71,271 additions and 12,012 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.js linguist-language=java
*.css linguist-language=java
*.html linguist-language=java
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ Just paste your stack trace here!
### Ⅵ. Environment:

- JDK version :
- Seata version:
- OS :
- Others:
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- Please make sure you have read and understood the contributing guidelines -->

- [ ] I have registered the PR [changes](https://github.com/seata/seata/tree/develop/changes).

### Ⅰ. Describe what this PR did


Expand Down
83 changes: 53 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,66 @@
name: build
name: "build"

on:
push:
branches: [ develop,master ]
branches: [ 2.x, develop, master ]
pull_request:
branches: [ develop,master ]
branches: [ 2.x, develop, master ]

jobs:
# job 1: Test based on java 8 and 17. Do not checkstyle.
build:

runs-on: ${{ matrix.os }}
name: "build"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [8, 11]
os: [ ubuntu-18.04 ]
java: [ 8, 17 ]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Setup Java JDK
uses: actions/setup-java@v2.1.0
# step 1
- name: "Checkout"
uses: actions/checkout@v3
# step 2
- name: "Set up Java JDK"
uses: actions/setup-java@v2.5.0
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Set up ENV
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: if [ "${{ matrix.java }}" == "8" ]; then
echo "IMAGE_NAME=openjdk:8u212-jre-alpine" >> $GITHUB_ENV;
elif [ "${{ matrix.java }}" == "11" ]; then
echo "IMAGE_NAME=openjdk:11-jre-stretch" >> $GITHUB_ENV;
fi
- name: Build with Maven
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
# https://docs.github.com/cn/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
run: if [ "${{github.event_name}}" == "push" ] && [ "${{github.ref}}" == "refs/heads/develop" ]; then
./mvnw clean install -DskipTests=false -Dcheckstyle.skip=false -Dlicense.skip=false -P image -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw clean install -DskipTests=false -Dcheckstyle.skip=false -Dlicense.skip=false -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
- name: Codecov
uses: codecov/codecov-action@v1.5.0
# step 3
- name: "Print maven version"
run: ./mvnw -version
# step 4
- name: "Build with Maven"
run: |
if [ "${{ matrix.java }}" == "8" ]; then
./mvnw -T 4C clean test -Dcheckstyle.skip=false -Dlicense.skip=false -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
elif [ "${{ matrix.java }}" == "17" ]; then
./mvnw -T 4C clean test -Dcheckstyle.skip=true -Dlicense.skip=true -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
# step 5
- name: "Codecov"
if: matrix.java == '17'
uses: codecov/codecov-action@v2.1.0

# job 2: Test on 'arm64v8/ubuntu' OS.
build_arm64-binary:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'snapshot' || github.ref_name == '2.x') }}
strategy:
fail-fast: false
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v3
# step 2
- name: "Set up QEMU"
id: qemu
uses: docker/setup-qemu-action@v1
# step 3
- name: "Build arm-binary"
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
arm64v8/ubuntu:20.04 \
bash -exc 'apt-get update -y && \
apt-get install maven -y && \
mvn -version && \
mvn -Prelease-seata -DskipTests clean install -U'
44 changes: 44 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "CodeQL"

on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ 2.x, develop ]
schedule:
- cron: '36 19 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'java' ]

steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v3

# step 2: Initializes the CodeQL tools for scanning.
- name: "Initialize CodeQL"
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# step 3
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: "Autobuild"
uses: github/codeql-action/autobuild@v2

# step 4
- name: "Perform CodeQL Analysis"
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
35 changes: 35 additions & 0 deletions .github/workflows/license-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: License checker

on:
pull_request:
branches: [ 2.x, develop, master ]

jobs:
check-license:
runs-on: ubuntu-latest
steps:
# step 1 clear cache
- name: Clear cache directory first before trying to restore from cache
run: sudo rm -rf $(go env GOMODCACHE) && sudo rm -rf $(go env GOCACHE)
shell: bash
# step 2 checkout
- name: Checkout
uses: actions/checkout@v3
# step 3 https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
- uses: actions/setup-node@v3
with:
node-version: '14.x'
# step 4 check license
- name: Check License Header
uses: apache/skywalking-eyes/header@8fc52baabc14c86294d96034bcc194cfa7f76b05
with:
log: info
config: .licenserc.yaml
mode: check
# step 5 heck dependencies
- name: Check Dependencies' License
uses: apache/skywalking-eyes/dependency@8fc52baabc14c86294d96034bcc194cfa7f76b05
with:
log: info
config: .licenserc.yaml
mode: check
55 changes: 55 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Publish Docker Image"

on:
push:
branches: [ snapshot, "*.*.*" ]
#tags: [ "*" ]

#This schedule only takes effect in the default branch
schedule:
- cron: '0 16 * * *' #GMT+0

jobs:
# job 1
publish-images-to-dockerhub:
name: "Publish images to DockerHub"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 8, 17 ]
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v3
# step 2
- name: "Setup Java JDK"
uses: actions/setup-java@v3.9.0
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
# step 3
- name: "Print maven version"
run: ./mvnw -version
# step 4 based on java8
- name: "Publish images to DockerHub based on java8"
if: matrix.java == 8
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
if [ "${{ github.ref_name }}" == "develop" ] || [ "${{ github.ref_name }}" == "snapshot" || [ "${{ github.ref_name }}" == "2.x" ]; then
./mvnw -T 4C clean package -Dimage.name=openjdk:8u342 -Pimage -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw -T 4C clean package -Dimage.name=openjdk:8u342 -Pimage,release-image-based-on-java8 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=openjdk:8u342-slim -Pimage,release-image-based-on-java8-slim -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
# step 4 based on java17
- name: "Publish images to DockerHub based on java17"
if: ${{ matrix.java == 17 && github.ref_name != 'develop' && github.ref_name != 'snapshot' && github.ref_name != '2.x' }}
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
./mvnw -T 4C clean package -Dimage.name=openjdk:17.0.2 -Pimage,release-image-based-on-java17 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=openjdk:17.0.2-slim -Pimage,release-image-based-on-java17-slim -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
39 changes: 39 additions & 0 deletions .github/workflows/publish-ossrh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Publish OSSRH"

on:
push:
branches: [ develop, 2.x, snapshot, "*.*.*" ]

jobs:
# job 1
publish-to-OSSRH:
name: "Publish to OSSRH"
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
# step 1
- name: "Checkout"
uses: actions/checkout@v2.4.0
# step 2
- name: "Setup Java JDK"
uses: actions/setup-java@v3.9.0
with:
distribution: 'zulu'
java-version: 8
server-id: oss_seata
server-username: OSSRH_USERNAME # Environment variable name for the username for authentication to the Apache Maven repository. Default is $GITHUB_ACTOR
server-password: OSSRH_PASSWORD # Environment variable name for password or token for authentication to the Apache Maven repository. Default is $GITHUB_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE # Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE
# step 3
- name: "Print maven version"
run: ./mvnw -version
# step 4
- name: "Publish to OSSRH"
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USER }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
./mvnw -T 4C clean deploy -Prelease,release-by-github-actions -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
Loading

0 comments on commit 41d1de1

Please sign in to comment.