diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6879126..c56f1a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,14 +8,23 @@ on: jobs: build: + name: Build (${{ matrix.platform }}) + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [windows-latest, macos-latest, ubuntu-latest] - - runs-on: ${{ matrix.os }} - + include: + - os: ubuntu-latest + platform: linux + - os: windows-latest + platform: windows + - os: macos-latest + platform: macos + - os: ubuntu-latest + platform: android steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 # Check out the flixelgdx library so Gradle can use the local included build # instead of pulling from JitPack (which avoids 401/authorization issues). @@ -25,52 +34,37 @@ jobs: repository: stringdotjar/flixelgdx path: flixelgdx - # LibGDX typically uses Java 11 or newer. - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'temurin' - # Cache Gradle dependencies to speed up subsequent runs. + distribution: temurin + java-version: 17 cache: 'gradle' - # Grant execute permission for gradlew (necessary for macOS and Linux). - - name: Grant execute permission for gradlew - run: chmod +x gradlew - # Use an 'if' condition to only run this on non-Windows OS. - if: startsWith(runner.os, 'macOS') || startsWith(runner.os, 'Linux') - - # This task compiles all modules (core, desktop, etc.). - - name: Build with Gradle - run: ./gradlew build - - build-android: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # Check out the flixelgdx library so Gradle can use the local included build - # instead of pulling from JitPack (which avoids 401/authorization issues). - - name: Checkout flixelgdx library - uses: actions/checkout@v4 + - name: Set up Android SDK + if: matrix.platform == 'android' + id: setup-android + uses: android-actions/setup-android@v3 with: - repository: stringdotjar/flixelgdx - path: flixelgdx + # Space-separated list (multiline is passed as one arg and breaks sdkmanager) + packages: "tools platform-tools platforms;android-36 build-tools;36.0.0" - # LibGDX typically uses Java 11 or newer, however we use Java 17 for modern standards. - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - # Cache Gradle dependencies to speed up subsequent runs. - cache: 'gradle' + - name: Create local.properties (Android) + if: matrix.platform == 'android' + run: | + SDK_DIR="${ANDROID_HOME:-/usr/local/lib/android/sdk}" + echo "sdk.dir=$SDK_DIR" >> local.properties - # Grant execute permission for gradlew. - name: Grant execute permission for gradlew + if: matrix.os != 'windows-latest' run: chmod +x gradlew - # Build Android module. - - name: Build Android with Gradle - run: ./gradlew android:build + - name: Build (LWJGL3) + if: matrix.platform == 'linux' || matrix.platform == 'windows' || matrix.platform == 'macos' + run: ./gradlew :polyverse:assemble :lwjgl3:assemble --no-daemon + shell: bash + + - name: Build (Android) + if: matrix.platform == 'android' + run: ./gradlew :polyverse:assemble :android:assembleRelease --no-daemon + shell: bash diff --git a/polyverse/src/main/java/me/stringdotjar/polyverse/PolyverseApp.java b/polyverse/src/main/java/me/stringdotjar/polyverse/PolyverseApp.java index f152c90..8634e9f 100644 --- a/polyverse/src/main/java/me/stringdotjar/polyverse/PolyverseApp.java +++ b/polyverse/src/main/java/me/stringdotjar/polyverse/PolyverseApp.java @@ -28,7 +28,6 @@ public void create() { Flixel.setDefaultLogTag("Polyverse"); displaySystemAndEngineInfo(); - displayGitInfo(); configureScriptSystem(); // Scripting and modding support. Flixel.info("Polyverse environment has been successfully initialized."); } @@ -83,28 +82,29 @@ public void resize(int width, int height) { } private void displaySystemAndEngineInfo() { + // Versions. Flixel.info("Polyverse Version: " + Polyverse.getVersion()); Flixel.info("Flixel Version: " + Flixel.getVersion()); + + // Java info. Flixel.info("Java Version: " + System.getProperty("java.version")); Flixel.info("Java Vendor: " + System.getProperty("java.vendor")); Flixel.info("Java Vendor URL: " + System.getProperty("java.vendor.url")); + + // Runtime and OS info. Flixel.info("Runtime Environment: " + FlixelRuntimeUtil.detectEnvironment()); Flixel.info("Platform: " + Flixel.getPlatform()); Flixel.info("Operating System: " + System.getProperty("os.name")); Flixel.info("Operating System Version: " + System.getProperty("os.version")); - } - private void displayGitInfo() { - if (FlixelRuntimeUtil.isRunningFromJar()) { - return; + // Git info. + if (!FlixelRuntimeUtil.isRunningFromJar()) { + var info = FlixelGitUtil.getRepoInfo(); + Flixel.info("Git Commit: " + info.commit()); + Flixel.info("Git Branch: " + info.branch()); + Flixel.info("Git Remote URL: " + info.remoteUrl()); + Flixel.info("Git Modified?: " + info.isModified()); } - - var info = FlixelGitUtil.getRepoInfo(); - - Flixel.info("Git Commit: " + info.commit()); - Flixel.info("Git Branch: " + info.branch()); - Flixel.info("Git Remote URL: " + info.remoteUrl()); - Flixel.info("Git Modified?: " + info.isModified()); } private void configureScriptSystem() {