Skip to content

Update build.yml

Update build.yml #68

Workflow file for this run

name: Windows Build
on:
push:
branches:
- master
pull_request:
paths:
- '**.java'
- '**.kts'
- 'brut.apktool/apktool-lib/src/main/resources/**'
- 'brut.apktool/apktool-lib/src/test/**'
- '.github/workflows/**'
- 'gradle/wrapper/**'
- 'gradlew'
- 'gradlew.bat'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BINARY_PATH: brut.apktool/apktool-lib/src/main/resources/prebuilt
jobs:
analyze-windows-aapt:
runs-on: windows-latest
strategy:
matrix:
file: [ aapt.exe, aapt_64.exe, aapt2.exe, aapt2_64.exe ]
steps:
- uses: actions/checkout@v3.0.2
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} version
- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} || true
build-apktool:
runs-on: ${{ matrix.os }}
needs:
- analyze-windows-aapt
name: Build/Test (JDK ${{ matrix.java }}, ${{ matrix.os }})
strategy:
fail-fast: true
matrix:
os: [ windows-latest ]
java: [ 19 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Build and test
uses: gradle/gradle-build-action@v2.7.1
with:
arguments: build shadowJar proguard
upload-artifact:
runs-on: ubuntu-latest
name: Build apktool.jar
if: github.repository == 'b4byhuey/Apktool' && github.ref == 'refs/heads/master'
needs:
- analyze-windows-aapt
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Build
uses: gradle/gradle-build-action@v2.7.1
with:
arguments: build shadowJar proguard
- name: Upload
uses: actions/upload-artifact@v3.1.0
with:
name: apktool.jar
path: brut.apktool/apktool-cli/build/libs/apktool-v*
deploy_nightly:
name: Deploy Nightly Build
runs-on: ubuntu-latest
needs: [build-apktool]
steps:
- uses: actions/checkout@v3.0.2
- name: Download Apktool
uses: actions/download-artifact@v3
with:
name: apktool.jar
path: win/
- name: Remove the old Release
uses: dev-drprasad/delete-older-releases@v0.2.0
with:
keep_latest: 0
delete_tag_pattern: "windows"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1.10.0
with:
artifacts: "win/*.*"
name: "Snapshots for Windows"
prerelease: true
replacesArtifacts: false
allowUpdates: false
tag: windows
token: ${{ secrets.GITHUB_TOKEN }}