From d691f52eff2519599de78c352035195091deba24 Mon Sep 17 00:00:00 2001 From: b4byhuey <60543438+b4byhuey@users.noreply.github.com> Date: Mon, 28 Aug 2023 21:47:15 +0800 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 82 ++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12247ab08f..55c2786bb5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: CI +name: Windows Build on: push: branches: @@ -21,60 +21,35 @@ env: BINARY_PATH: brut.apktool/apktool-lib/src/main/resources/prebuilt jobs: - analyze-mac-aapt: - runs-on: macos-latest - strategy: - matrix: - file: [ aapt_64, aapt2_64 ] - steps: - - uses: actions/checkout@v3 - - 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@v3 - - 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@v3 + - 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-and-test-with-Java-8-and-later: + + build-apktool: runs-on: ${{ matrix.os }} - needs: - - analyze-mac-aapt - - analyze-linux-aapt + needs: - 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, 11, 17, 18, 19, 20 ] + os: [ windows-latest ] + java: [ 20 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.0.2 - 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: @@ -83,11 +58,11 @@ jobs: upload-artifact: runs-on: ubuntu-latest name: Build apktool.jar - if: github.repository == 'iBotPeaches/Apktool' && github.ref == 'refs/heads/master' + if: github.repository == 'b4byhuey/Apktool' && github.ref == 'refs/heads/master' needs: - - build-and-test-with-Java-8-and-later + - analyze-windows-aapt steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.0.2 with: fetch-depth: 0 - uses: actions/setup-java@v3 @@ -99,7 +74,38 @@ jobs: with: arguments: build shadowJar proguard - name: Upload - uses: actions/upload-artifact@v3 + 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 }}