Apktool/.github/workflows/build.yml
Connor Tumbleson 8bcab69f25
Merge pull request #2644 from iBotPeaches/detect-valid-aapt-builds
feat: check aapt/aapt binaries for execution and list static nature
2021-09-01 07:23:39 -04:00

155 lines
3.9 KiB
YAML

name: CI
env:
BINARY_PATH: brut.apktool/apktool-lib/src/main/resources/prebuilt
on:
push:
branches:
- master
pull_request:
paths:
- '**.java'
- '**.gradle'
- 'brut.apktool/apktool-lib/src/main/resources/**'
- '.github/workflows/**'
jobs:
analyze-mac-aapt:
runs-on: macos-latest
strategy:
matrix:
file: [aapt_64, aapt2_64]
steps:
- uses: actions/checkout@v2
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/macosx/${{ matrix.file }} version
- name: Output Static
run: otool -L ${{ env.BINARY_PATH }}/macosx/${{ matrix.file }} || true
analyze-linux-aapt:
runs-on: ubuntu-latest
strategy:
matrix:
file: [aapt, aapt_64, aapt2, aapt2_64]
steps:
- uses: actions/checkout@v2
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/linux/${{ matrix.file }} version
- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/linux/${{ matrix.file }} || true
analyze-windows-aapt:
runs-on: windows-latest
strategy:
matrix:
file: [aapt.exe, aapt_64.exe, aapt2.exe, aapt2_64.exe]
steps:
- uses: actions/checkout@v2
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} version
- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} || true
build-and-test-with-Java-8-and-later:
runs-on: ${{ matrix.os }}
needs:
- analyze-mac-aapt
- analyze-linux-aapt
- analyze-windows-aapt
name: Build/Test (JDK ${{ matrix.java }}, ${{ matrix.os }})
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
java: [ 8, 9, 10, 11, 12, 13, 14, 15, 16 ]
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.java }}-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-${{ matrix.java }}-gradle-
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Build and test
if: startsWith(matrix.os, 'windows') == true
run: ./gradlew.bat build shadowJar proguard
- name: Build and test
if: startsWith(matrix.os, 'windows') != true
run: ./gradlew build shadowJar proguard
upload-artifact:
runs-on: ubuntu-latest
name: Build apktool.jar
if: github.repository == 'iBotPeaches/Apktool' && github.ref == 'refs/heads/master'
needs:
- build-and-test-with-Java-8-and-later
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.java }}-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-${{ matrix.java }}-gradle-
- uses: actions/checkout@v2
- name: Set up JDK 10
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 10
- name: Build
run: ./gradlew build shadowJar proguard
- name: Upload
uses: actions/upload-artifact@v2
with:
name: apktool.jar
path: brut.apktool/apktool-cli/build/libs/apktool-*-small.jar
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1