Merge pull request #2569 from microsoftgraph/release-please--branches… #2437
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: Gradle Build and Compare Package | |
| on: | |
| push: | |
| branches: [main, support/5.x.x] | |
| pull_request: | |
| branches: [main, support/5.x.x] | |
| workflow_dispatch: | |
| jobs: | |
| build-java-latest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Move generated sources to correct package | |
| run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated' | |
| shell: pwsh | |
| - name: Grant Execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Upload Unit Test Results | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: UnitTests | |
| path: | | |
| build/reports/tests/test/** | |
| build/test-results/** | |
| - name: Upload a Build Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: drop | |
| path: | | |
| **/libs/* | |
| build/generated-pom.xml | |
| build/generated-pom.xml.asc | |
| build.gradle | |
| gradlew | |
| gradlew.bat | |
| settings.gradle | |
| gradle.properties | |
| **/gradle/** | |
| scripts/** | |
| build-java-8: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 8 | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Move generated sources to correct package | |
| run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated' | |
| shell: pwsh | |
| - name: Grant Execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Java 8 | |
| working-directory: ./java-8 | |
| run: .././gradlew build | |
| build: | |
| needs: [build-java-latest, build-java-8] | |
| runs-on: ubuntu-latest | |
| if: ${{ always() }} | |
| steps: | |
| - name: Determine build status | |
| run: | | |
| if [ "${{ needs.build-java-latest.result }}" == "success" ] && [ "${{ needs.build-java-8.result }}" == "success" ]; then | |
| exit 0 | |
| else | |
| exit 1 | |
| fi | |