Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 2.1.20 to 2.3.20 #215
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: Build NGE | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [published, released] | |
| jobs: | |
| Checkstyle: | |
| name: Run Checkstyle | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Setup the java environment | |
| uses: actions/setup-java@v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Validate the Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v5.0.2 | |
| - name: Run Checkstyle | |
| run: | | |
| ./gradlew checkstyleMain checkstyleTest --console=plain --stacktrace | |
| - name: Upload Checkstyle Reports | |
| uses: actions/upload-artifact@v7.0.0 | |
| if: always() | |
| with: | |
| name: checkstyle-report | |
| retention-days: 30 | |
| path: | | |
| **/build/reports/checkstyle/** | |
| SpotBugs: | |
| name: Run SpotBugs | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Setup the java environment | |
| uses: actions/setup-java@v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Validate the Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v5.0.2 | |
| - name: Run SpotBugs | |
| run: | | |
| ./gradlew -PenableSpotBugs=true spotbugsMain spotbugsTest --console=plain --stacktrace | |
| - name: Upload SpotBugs Reports | |
| uses: actions/upload-artifact@v7.0.0 | |
| if: always() | |
| with: | |
| name: spotbugs-report | |
| retention-days: 30 | |
| path: | | |
| **/build/reports/spotbugs/** | |
| ScreenshotTests: | |
| name: Run Screenshot Tests | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/onemillionworlds/opengl-docker-image:v1 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Start xvfb | |
| run: | | |
| Xvfb :99 -ac -screen 0 1024x768x16 & | |
| export DISPLAY=:99 | |
| echo "DISPLAY=:99" >> $GITHUB_ENV | |
| - name: Report GL/Vulkan | |
| run: | | |
| set -x | |
| echo "DISPLAY=$DISPLAY" | |
| glxinfo | grep -E "OpenGL version|OpenGL renderer|OpenGL vendor" || true | |
| vulkaninfo --summary || true | |
| echo "VK_ICD_FILENAMES=$VK_ICD_FILENAMES" | |
| echo "MESA_LOADER_DRIVER_OVERRIDE=$MESA_LOADER_DRIVER_OVERRIDE" | |
| echo "GALLIUM_DRIVER=$GALLIUM_DRIVER" | |
| - name: Validate the Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v5.0.2 | |
| - name: Test with Gradle Wrapper | |
| run: | | |
| ./gradlew :jme3-screenshot-test:screenshotTest | |
| - name: Upload Test Reports | |
| uses: actions/upload-artifact@v7.0.0 | |
| if: always() | |
| with: | |
| name: screenshot-test-report | |
| retention-days: 30 | |
| path: | | |
| **/build/reports/** | |
| **/build/changed-images/** | |
| **/build/test-results/** | |
| # Build iOS natives | |
| BuildIosNatives: | |
| name: Build natives for iOS | |
| runs-on: macOS-14 | |
| steps: | |
| - name: Check default JAVAs | |
| run: echo $JAVA_HOME --- $JAVA_HOME_8_X64 --- $JAVA_HOME_11_X64 --- $JAVA_HOME_17_X64 --- $JAVA_HOME_21_X64 --- | |
| - name: Setup the java environment | |
| uses: actions/setup-java@v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup the XCode version to 15.1.0 | |
| uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0 | |
| with: | |
| xcode-version: '15.1.0' | |
| - name: Clone the repo | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Validate the Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v5.0.2 | |
| - name: Build | |
| run: | | |
| ./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \ | |
| :jme3-ios-native:build | |
| - name: Upload natives | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: ios-natives | |
| path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework | |
| # Build the natives on android | |
| BuildAndroidNatives: | |
| name: Build natives for android | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/cirruslabs/android-sdk:36-ndk | |
| steps: | |
| - name: Clone the repo | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Java 17 | |
| uses: actions/setup-java@v5.2.0 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Check java version | |
| run: java -version | |
| - name: Install CMake | |
| run: | | |
| apt-get update | |
| apt-get install -y cmake | |
| cmake --version | |
| - name: Validate the Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v5.0.2 | |
| - name: Build | |
| run: | | |
| export ANDROID_NDK="$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION" | |
| ./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \ | |
| :jme3-android-native:assemble | |
| - name: Upload natives | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: android-natives | |
| path: build/native | |
| # Build the engine, we only deploy from ubuntu-latest jdk25 | |
| BuildJMonkey: | |
| needs: [BuildAndroidNatives, BuildIosNatives] | |
| name: Build on ${{ matrix.osName }} jdk${{ matrix.jdk }} | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| pages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest,windows-latest,macOS-latest] | |
| jdk: [17, 21, 25] | |
| include: | |
| - os: ubuntu-latest | |
| osName: linux | |
| deploy: true | |
| - os: windows-latest | |
| osName: windows | |
| deploy: false | |
| - os: macOS-latest | |
| osName: mac | |
| deploy: false | |
| - jdk: 17 | |
| deploy: false | |
| - jdk: 21 | |
| deploy: false | |
| steps: | |
| - name: Clone the repo | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup the java environment | |
| uses: actions/setup-java@v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Download natives for android | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: android-natives | |
| path: build/native | |
| - name: Download natives for iOS | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: ios-natives | |
| path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework | |
| - name: Validate the Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v5.0.2 | |
| - name: Build Engine | |
| shell: bash | |
| run: | | |
| # Normal build plus ZIP distribution and merged javadoc | |
| ./gradlew -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true \ | |
| -x checkstyleMain -x checkstyleTest \ | |
| build createZipDistribution mergedJavadoc | |
| if [ "${{ matrix.deploy }}" = "true" ]; | |
| then | |
| # We are going to need "zip" | |
| sudo apt-get update | |
| sudo apt-get install -y zip | |
| # We prepare the release for deploy | |
| mkdir -p ./dist/release/ | |
| mv build/distributions/*.zip dist/release/ | |
| # Install maven artifacts to ./dist/maven and sign them if possible | |
| if [ "${{ secrets.SIGNING_PASSWORD }}" = "" ]; | |
| then | |
| echo "Configure the following secrets to enable signing:" | |
| echo "SIGNING_KEY, SIGNING_PASSWORD" | |
| ./gradlew publishMavenPublicationToDistRepository \ | |
| -PskipPrebuildLibraries=true -PuseCommitHashAsVersionName=true \ | |
| --console=plain --stacktrace | |
| else | |
| ./gradlew publishMavenPublicationToDistRepository \ | |
| -PsigningKey='${{ secrets.SIGNING_KEY }}' \ | |
| -PsigningPassword='${{ secrets.SIGNING_PASSWORD }}' \ | |
| -PskipPrebuildLibraries=true -PuseCommitHashAsVersionName=true \ | |
| --console=plain --stacktrace | |
| fi | |
| ./gradlew --no-daemon configureVersionInfo \ | |
| -PjmeVersionName="$VERSION" \ | |
| -PskipPrebuildLibraries=true \ | |
| build mergedJavadoc | |
| - name: "Create merged native zip" | |
| if: matrix.deploy == true | |
| shell: bash | |
| run: | | |
| cdir="$PWD" | |
| cd "build/native" | |
| zip -r "$cdir/dist/merged-natives.zip" * | |
| cd "$cdir" | |
| echo "Done" | |
| - name: Upload merged natives | |
| if: matrix.deploy==true | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: merged-natives | |
| path: dist/merged-natives.zip | |
| - name: Publish Snapshot | |
| if: matrix.deploy == true && github.event_name != 'pull_request' && ( github.event_name != 'release' || github.event.release.prerelease == true ) | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| run: | | |
| export VERSION="" | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| export VERSION=${GITHUB_REF#refs/tags/} | |
| export VERSION="${VERSION}rc-SNAPSHOT" | |
| echo "Publishing snapshot $VERSION" | |
| fi | |
| ./gradlew --no-daemon --no-parallel configureVersionInfo \ | |
| -PjmeVersionName="$VERSION" \ | |
| -PskipPrebuildLibraries=true \ | |
| publishToSonatype publishAllPublicationsToDistFolderRepository --info | |
| - name: Publish Release | |
| if: matrix.deploy == true && github.event_name == 'release' && github.event.release.prerelease == false | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| run: | | |
| export VERSION="" | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| export VERSION=${GITHUB_REF#refs/tags/} | |
| echo "Publishing release $VERSION" | |
| fi | |
| ./gradlew --no-daemon --no-parallel configureVersionInfo \ | |
| -PjmeVersionName="$VERSION" \ | |
| -PskipPrebuildLibraries=true \ | |
| publishToSonatype closeAndReleaseSonatypeStagingRepository publishAllPublicationsToDistFolderRepository --info | |
| - name: Upload maven artifacts | |
| if: matrix.deploy==true | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: maven-artifacts | |
| path: dist/maven | |
| - name: Upload pages artifact | |
| if: matrix.deploy==true | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'dist/javadoc' | |
| - name: Deploy to GitHub Pages | |
| if: matrix.deploy==true && github.event_name == 'release' | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |