release v1.1.0 for all modules #85
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java Main Workflow | |
| on: | |
| # pull_request: | |
| # branches: [ master, rc-** ] | |
| jobs: | |
| detect-targets: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| modified_targets: ${{ steps.filter.outputs.modified_targets }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| - name: Detect modified targets | |
| id: filter | |
| run: | | |
| MODIFIED_TARGETS=() | |
| # Ensure HEAD^ exists | |
| if git rev-parse --verify HEAD^ >/dev/null 2>&1; then | |
| BASE_COMMIT="HEAD^" | |
| else | |
| BASE_COMMIT=$(git rev-list --max-parents=0 HEAD) # First commit | |
| fi | |
| # Check each client dynamically | |
| find clients/* -type d -maxdepth 0 | while read client; do | |
| CLIENT_NAME=$(basename "$client") | |
| if ! git diff --quiet "$BASE_COMMIT" HEAD -- "$client"; then | |
| echo "Changes detected in $CLIENT_NAME" | |
| MODIFIED_TARGETS+=("$CLIENT_NAME") | |
| fi | |
| done | |
| # Convert to JSON array format | |
| MODIFIED_TARGETS_JSON=$(printf '%s\n' "${MODIFIED_TARGETS[@]}" | jq -R -s -c 'split("\n") | map(select(. != ""))') | |
| echo "Detected modified targets: $MODIFIED_TARGETS_JSON" | |
| echo "modified_targets=$MODIFIED_TARGETS_JSON" >> $GITHUB_ENV | |
| echo "::set-output name=modified_targets::$MODIFIED_TARGETS_JSON" | |
| checkstyle: | |
| runs-on: ubuntu-latest | |
| needs: detect-targets | |
| if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 17 | |
| distribution: 'adopt' | |
| cache: 'maven' | |
| cache-dependency-path: | | |
| 'clients/pom.xml' | |
| 'examples/pom.xml' | |
| - name: Validate modules | |
| run: | | |
| mvn -f clients/pom.xml -N install | |
| mvn -f clients/pom.xml -pl common install | |
| mvn -f clients/pom.xml -pl `echo '${{ needs.detect-targets.outputs.modified_targets }}' | jq -r 'join(",")'` validate | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: detect-targets | |
| if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }} | |
| strategy: | |
| matrix: | |
| target: ${{ fromJson(needs.detect-targets.outputs.modified_targets) }} | |
| java-version: [ 11, 17 ] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'adopt' | |
| cache: 'maven' | |
| cache-dependency-path: | | |
| 'clients/pom.xml' | |
| 'examples/pom.xml' | |
| - name: Build ${{ matrix.target }} module | |
| run: | | |
| mvn -f clients/pom.xml -N install | |
| mvn -f clients/pom.xml -pl common,${{ matrix.target }} install -Dcheckstyle.skip=true |