From 851cb9df07c51c804d55a9cfee864c4b5a453c56 Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Thu, 13 Oct 2022 22:22:59 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=91=B7=20Reusable=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-apk.yml | 27 +++---------------- ...ld-apk-artifact.yml => build-artifact.yml} | 18 ++++++------- .github/workflows/codeql-analysis.yml | 20 +++++++------- .github/workflows/pr-checks.yml | 2 +- 4 files changed, 22 insertions(+), 45 deletions(-) rename .github/workflows/{build-apk-artifact.yml => build-artifact.yml} (70%) diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index f5e0718..11ec74b 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -22,30 +22,9 @@ concurrency: cancel-in-progress: true jobs: build-apk: - name: APK Build - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - name: Check out Git repository - uses: actions/checkout@v3 - - - name: Update Env for custom build - run: | - echo "${{ secrets.ENVS }}" >> .env - - - name: Build Revanced APKs - run: | - docker-compose up - - - name: Upload Build APKS - uses: actions/upload-artifact@v3 - with: - name: Built-APKs - path: | - apks/*-output.apk - apks/VancedMicroG.apk" - if-no-files-found: error + uses: ./.github/workflows/build-artifact.yml + secrets: + ENVS: ${{ secrets.ENVS }} upload-to-github: name: GitHub Upload diff --git a/.github/workflows/build-apk-artifact.yml b/.github/workflows/build-artifact.yml similarity index 70% rename from .github/workflows/build-apk-artifact.yml rename to .github/workflows/build-artifact.yml index ee88850..6215158 100644 --- a/.github/workflows/build-apk-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -1,18 +1,21 @@ -name: Build Artifacts PR +name: Build Revanced APK env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 on: workflow_call: + secrets: + ENVS: + required: false concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: - build-apk-pr: + build-apk: name: APK Build runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 10 steps: - name: Check out Git repository @@ -26,15 +29,10 @@ jobs: run: | docker-compose up - - name: Get Date - id: get-date - run: | - echo ::set-output name=date::$(TZ='Asia/Kolkata' date +"%Y.%m.%d-%H.%M.%S") - - - name: Upload Build Artifact + - name: Upload Build APKS uses: actions/upload-artifact@v3 with: - name: Build APKs + name: Built-APKs path: | apks/*-output.apk apks/VancedMicroG.apk" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6741067..b4befe3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,16 +19,16 @@ jobs: language: [ 'python' ] steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + - name: Autobuild + uses: github/codeql-action/autobuild@v2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 0131384..bd8ae7d 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -11,4 +11,4 @@ jobs: linter-pr-check: uses: ./.github/workflows/linter.yml build-apk-pr-check: - uses: ./.github/workflows/build-apk-artifact.yml + uses: ./.github/workflows/build-artifact.yml From 7cae2301d41733ba16a577268c4b73af155d55e1 Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Thu, 13 Oct 2022 22:32:18 +0530 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=91=B7=20Rename=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-apk.yml | 2 +- .github/workflows/build-artifact.yml | 5 +---- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/linter.yml | 3 --- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index 11ec74b..759734e 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -1,4 +1,4 @@ -name: Build Revanced APK +name: Build & Release env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 6215158..d5e1012 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -1,4 +1,4 @@ -name: Build Revanced APK +name: Build & Upload env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 @@ -8,9 +8,6 @@ on: ENVS: required: false -concurrency: - group: ${{ github.head_ref || github.run_id }} - cancel-in-progress: true jobs: build-apk: name: APK Build diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b4befe3..76d042c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,4 +1,4 @@ -name: "CodeQL" +name: CodeQL Analysis on: workflow_dispatch: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index eb1f1ef..3373f30 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -8,9 +8,6 @@ on: workflow_call: workflow_dispatch: -concurrency: - group: ${{ github.head_ref || github.run_id }} - cancel-in-progress: true jobs: linter: