diff --git a/.github/workflows/nativeCompile.yml b/.github/workflows/build.yml similarity index 51% rename from .github/workflows/nativeCompile.yml rename to .github/workflows/build.yml index 61ee44a..5bc5546 100644 --- a/.github/workflows/nativeCompile.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: GraalVM Native Image builds +name: Build AppleCommander disassembler on: push: @@ -9,8 +9,50 @@ on: branches: [ "main" ] jobs: - build: + build-java: + runs-on: ubuntu-latest + steps: + - 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 + run: ./gradlew build + - name: Upload artifacts + uses: actions/upload-artifact@v7 + with: + name: build-artifacts + path: cli/build/libs/acdasm-*.jar + 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: acdasm on ${{ matrix.os }}-${{ matrix.arch }} + needs: [build-java, license-check] runs-on: ${{ matrix.label }} strategy: matrix: @@ -34,14 +76,12 @@ 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' - # Note that Graal v21 builds to the current architecture, and "--target" is not functional. # Therefore, we try to find runners that fit our targets (see above). - name: Build 'acdasm' @@ -49,9 +89,15 @@ 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: | + cli/build/native/nativeCompile/acdasm* - name: Upload binary uses: actions/upload-artifact@v7 with: name: acdasm-${{ matrix.os }}-${{ matrix.arch }} path: cli/build/native/nativeCompile/acdasm* + archive: false diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index a038b80..0000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,42 +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 acdasm CLI and API - -on: - push: - branches: [ "main" ] - tags: - - '*' - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - 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 - run: ./gradlew build - - name: Upload artifacts - uses: actions/upload-artifact@v7 - with: - name: build-artifacts - path: cli/build/libs/acdasm-*.jar - if-no-files-found: error diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml deleted file mode 100644 index 926348e..0000000 --- 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 'acdasm' files have 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" | 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