From dbca003d1704f2a542bc21cc2f4c3fd0dc4e6854 Mon Sep 17 00:00:00 2001 From: A2 Geek Date: Sat, 25 Jul 2026 13:58:17 -0500 Subject: [PATCH 1/5] Add Java build and license check workflows --- .../{nativeCompile.yml => build.yml} | 61 +++++++++++++++++-- 1 file changed, 56 insertions(+), 5 deletions(-) rename .github/workflows/{nativeCompile.yml => build.yml} (53%) diff --git a/.github/workflows/nativeCompile.yml b/.github/workflows/build.yml similarity index 53% rename from .github/workflows/nativeCompile.yml rename to .github/workflows/build.yml index 95d78b9e..29d5edcd 100644 --- a/.github/workflows/nativeCompile.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,61 @@ on: branches: [ "main" ] jobs: - build: + build-java: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v7 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + - name: Build with Gradle + env: + # The SWT image tests fail in the pipeline; disable them. + AC_SKIP_SWT_TESTS: true + run: ./gradlew build + - name: Upload 'ac' + uses: actions/upload-artifact@v7 + with: + name: build-artifacts + path: app/cli-ac/build/libs/AppleCommander-ac* + archive: false + if-no-files-found: error + - name: Upload 'acx' + uses: actions/upload-artifact@v7 + with: + name: build-artifacts + path: app/cli-acx/build/libs/AppleCommander-acx* + archive: false + if-no-files-found: error + + # This is a crude license header check. The ones I tested were susceptible to whitespace differences + # and I never got them to work. My primary goal is to ensure the headers exist, so this suffices. + license-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v7 + - name: Look for license phrase + run: | + outfile=$(mktemp) + find . -name "*.java" | xargs grep -L "GNU General Public License" > ${outfile} + if [ -s "${outfile}" ] + then + echo "License headers missing on the following files:" + cat ${outfile} + exit 1 + else + echo "License headers appear to be valid!" + fi + + build-native: name: ac/acx on ${{ matrix.os }}-${{ matrix.arch }} + needs: [build-java, license-check] runs-on: ${{ matrix.label }} strategy: matrix: @@ -36,32 +89,30 @@ jobs: arch: arm64 steps: - uses: actions/checkout@v7 - - uses: graalvm/setup-graalvm@v1 with: java-version: '25' distribution: 'liberica' github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'true' - - name: Build ac/acx run: ./gradlew nativeCompile env: # Needed for Windows; not an issue for other OSes GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }} - - name: Run CLTH tests if: ${{ matrix.os != 'windows' }} shell: bash run: ./scripts/run-clth-tests.sh - - name: Upload binary uses: actions/upload-artifact@v7 with: name: ac-${{ matrix.os }}-${{ matrix.arch }} path: app/cli-ac/build/native/nativeCompile/ac-* + archive: false - name: Upload binary uses: actions/upload-artifact@v7 with: name: acx-${{ matrix.os }}-${{ matrix.arch }} path: app/cli-acx/build/native/nativeCompile/acx-* + archive: false From 60c1c924357b45503fb6c2a5df905a8bea2b947e Mon Sep 17 00:00:00 2001 From: A2 Geek Date: Sat, 25 Jul 2026 13:58:41 -0500 Subject: [PATCH 2/5] Delete .github/workflows/gradle.yml --- .github/workflows/gradle.yml | 50 ------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index e57ff1d3..00000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Build AppleCommander - -on: - push: - branches: [ "main" ] - tags: - - '*' - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v7 - - name: Set up JDK 21 - uses: actions/setup-java@v5 - with: - java-version: '21' - distribution: 'temurin' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Build with Gradle - env: - # The SWT image tests fail in the pipeline; disable them. - AC_SKIP_SWT_TESTS: true - run: ./gradlew build - - name: Collect artifacts - run: | - mkdir artifacts - cp $(find app/ -name "AppleCommander-*.jar") artifacts/ - - name: Upload artifacts - uses: actions/upload-artifact@v7 - with: - name: build-artifacts - path: artifacts/ - if-no-files-found: error From 48d78cf955e5e5235f0c9d9bfed70ed01dd6ffd7 Mon Sep 17 00:00:00 2001 From: A2 Geek Date: Sat, 25 Jul 2026 13:58:54 -0500 Subject: [PATCH 3/5] Delete .github/workflows/license.yml --- .github/workflows/license.yml | 36 ----------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/license.yml diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml deleted file mode 100644 index 1b998fb9..00000000 --- a/.github/workflows/license.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This is a crude license header check. The ones I tested were susceptible to whitespace differences -# and I never got them to work. My primary goal is to ensure the headers exist, so this suffices. - -name: Verify AppleCommander has a license header - -on: - push: - branches: [ "main" ] - tags: - - '*' - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v7 - - name: Look for license phrase - run: | - outfile=$(mktemp) - find . -name "*.java" -not -name "Sleak.java" | xargs grep -L "GNU General Public License" > ${outfile} - if [ -s "${outfile}" ] - then - echo "License headers missing on the following files:" - cat ${outfile} - exit 1 - else - echo "License headers appear to be valid!" - fi From 562db351ab106674e1557fe3a3fd0bd5b836072e Mon Sep 17 00:00:00 2001 From: A2 Geek Date: Sat, 25 Jul 2026 14:00:33 -0500 Subject: [PATCH 4/5] Exclude Sleak.java from license check --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29d5edcd..81413939 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: - name: Look for license phrase run: | outfile=$(mktemp) - find . -name "*.java" | xargs grep -L "GNU General Public License" > ${outfile} + find . -name "*.java" -not -name "Sleak.java" | xargs grep -L "GNU General Public License" > ${outfile} if [ -s "${outfile}" ] then echo "License headers missing on the following files:" From c13c19313647f35d027d6864d4e44b289a589200 Mon Sep 17 00:00:00 2001 From: A2 Geek Date: Sat, 25 Jul 2026 14:07:20 -0500 Subject: [PATCH 5/5] Add UPX step to build workflow Added a step to run UPX for compressing binaries on Windows and Linux. --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81413939..3154a72b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,6 +100,13 @@ jobs: env: # Needed for Windows; not an issue for other OSes GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }} + - name: Run UPX + uses: crazy-max/ghaction-upx@v4 + if: runner.os == 'Windows' || runner.os == 'Linux' + with: + files: | + app/cli-ac/build/native/nativeCompile/ac-* + app/cli-acx/build/native/nativeCompile/acx-* - name: Run CLTH tests if: ${{ matrix.os != 'windows' }} shell: bash