From 585714fcdcbb32e98846b97020908558ed877aad Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Tue, 6 Feb 2024 16:54:21 +0100 Subject: [PATCH 1/4] Adapt Android manual workflow to only deploy --- .github/workflows/android-manual-release.yml | 33 ++++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/android-manual-release.yml b/.github/workflows/android-manual-release.yml index 560fa50..88b3d91 100644 --- a/.github/workflows/android-manual-release.yml +++ b/.github/workflows/android-manual-release.yml @@ -24,17 +24,30 @@ jobs: echo "build-number=$build_number" >> $GITHUB_OUTPUT echo "Build Number: $build_number" - branch: - needs: [generate-build-number] - uses: QuickBirdEng/workflows/.github/workflows/android-common.yml@main - with: - build-number: ${{ needs.generate-build-number.outputs.build-number }} - secrets: inherit - - publish-apps-qb: + android-publish: runs-on: [self-hosted, Linux] - needs: [branch] + needs: [generate-build-number] steps: + - uses: actions/checkout@v3 + - run: echo "BuildForRelease=true" >> $GITHUB_ENV + - uses: QuickBirdEng/actions/setup-version@main + with: + build-number: ${{ needs.generate-build-number.outputs.build-number }} + - uses: QuickBirdEng/actions/setup-android@main + with: + key-store-file-content: ${{ secrets.ANDROID_KEYSTORE_FILE_CONTENT }} + key-store-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + signing-key-alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} + signing-key-password: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} + - name: Setup API Key (if secret is set) + shell: bash + run: | + if [[ '${{ secrets.RAW_API_KEY }}' != '' ]]; then + echo "RAW_API_KEY=${{ secrets.RAW_API_KEY }}" >> .env.credentials + fi + - name: Generate APK + shell: bash + run: ./gradlew assembleRelease - name: "Publishing to apps.quickbirdstudios.com" uses: QuickBirdEng/actions/qb-publish@main with: @@ -43,7 +56,7 @@ jobs: android-bundle: runs-on: [self-hosted, Linux] - needs: [generate-build-number, branch] + needs: [generate-build-number] steps: - uses: actions/checkout@v3 - run: echo "BuildForRelease=true" >> $GITHUB_ENV From 89162a9cd9a49cabaa92c333f680e7b38bca7ad5 Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Tue, 6 Feb 2024 17:04:48 +0100 Subject: [PATCH 2/4] add lfs support to android manual deploy --- .github/workflows/android-manual-release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/android-manual-release.yml b/.github/workflows/android-manual-release.yml index 88b3d91..c349729 100644 --- a/.github/workflows/android-manual-release.yml +++ b/.github/workflows/android-manual-release.yml @@ -2,6 +2,11 @@ name: Manual Release Workflow on: workflow_call: + inputs: + lfs: + description: 'Whether to use LFS for the artifacts' + type: boolean + default: false workflow_dispatch: env: @@ -29,6 +34,8 @@ jobs: needs: [generate-build-number] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main with: @@ -59,6 +66,8 @@ jobs: needs: [generate-build-number] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main with: From 5ebde75d186fea9e81017288d7ffae07ffc5c1b2 Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Tue, 6 Feb 2024 17:18:01 +0100 Subject: [PATCH 3/4] add lfs to all android workflows --- .github/workflows/android-common-with-lint.yml | 17 +++++++++++++++-- .github/workflows/android-common.yml | 15 ++++++++++++--- .github/workflows/android-manual-release.yml | 1 - .github/workflows/android-release-with-lint.yml | 13 ++++++++++--- .github/workflows/android-release.yml | 14 +++++++++++--- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.github/workflows/android-common-with-lint.yml b/.github/workflows/android-common-with-lint.yml index 454b109..5b3fc44 100644 --- a/.github/workflows/android-common-with-lint.yml +++ b/.github/workflows/android-common-with-lint.yml @@ -9,6 +9,11 @@ on: description: 'Build Number' type: string required: false + lfs: + description: 'Whether to use LFS for the artifacts' + type: boolean + default: false + workflow_dispatch: concurrency: @@ -20,18 +25,24 @@ jobs: runs-on: [self-hosted, Linux] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - uses: QuickBirdEng/actions/setup-android-for-build@main - run: ./gradlew quickLint unitTests: runs-on: [self-hosted, Linux] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - uses: QuickBirdEng/actions/setup-android-for-build@main - run: ./gradlew test androidTests: runs-on: [self-hosted, Linux, android] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - uses: QuickBirdEng/actions/setup-android-for-build@main - run: ./gradlew cAT --stacktrace android-publish: @@ -39,9 +50,11 @@ jobs: needs: [lint, unitTests, androidTests] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main - with: + with: build-number: ${{ inputs.build-number }} - uses: QuickBirdEng/actions/setup-android@main with: @@ -51,4 +64,4 @@ jobs: signing-key-password: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} - name: Generate APK shell: bash - run: ./gradlew assembleRelease \ No newline at end of file + run: ./gradlew assembleRelease diff --git a/.github/workflows/android-common.yml b/.github/workflows/android-common.yml index 6e89972..3ebc9d8 100644 --- a/.github/workflows/android-common.yml +++ b/.github/workflows/android-common.yml @@ -9,7 +9,10 @@ on: description: 'Build Number' type: string required: false - workflow_dispatch: + lfs: + description: 'Whether to use LFS for the artifacts' + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -20,6 +23,8 @@ jobs: runs-on: [self-hosted, Linux] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - uses: QuickBirdEng/actions/setup-android-for-build@main - name: Setup API Key (if secret is set) shell: bash @@ -32,6 +37,8 @@ jobs: runs-on: [self-hosted, Linux, android] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - uses: QuickBirdEng/actions/setup-android-for-build@main - name: Setup API Key (if secret is set) shell: bash -l {0} @@ -45,9 +52,11 @@ jobs: needs: [unitTests, androidTests] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main - with: + with: build-number: ${{ inputs.build-number }} - uses: QuickBirdEng/actions/setup-android@main with: @@ -63,4 +72,4 @@ jobs: fi - name: Generate APK shell: bash - run: ./gradlew assembleRelease \ No newline at end of file + run: ./gradlew assembleRelease diff --git a/.github/workflows/android-manual-release.yml b/.github/workflows/android-manual-release.yml index c349729..0ec53e7 100644 --- a/.github/workflows/android-manual-release.yml +++ b/.github/workflows/android-manual-release.yml @@ -7,7 +7,6 @@ on: description: 'Whether to use LFS for the artifacts' type: boolean default: false - workflow_dispatch: env: ENVIRONMENT_FILE: .env diff --git a/.github/workflows/android-release-with-lint.yml b/.github/workflows/android-release-with-lint.yml index 7f4830a..abf5e1b 100644 --- a/.github/workflows/android-release-with-lint.yml +++ b/.github/workflows/android-release-with-lint.yml @@ -1,8 +1,12 @@ name: Release Workflow on: - workflow_call: - workflow_dispatch: + workflow_call: + inputs: + lfs: + description: 'Whether to use LFS for the artifacts' + type: boolean + default: false env: ENVIRONMENT_FILE: .env @@ -19,7 +23,7 @@ jobs: steps: - name: Generate Build Number id: build-number-generator - run: | + run: | build_number=$(date +%s) echo "build-number=$build_number" >> $GITHUB_OUTPUT echo "Build Number: $build_number" @@ -29,6 +33,7 @@ jobs: uses: ./.github/workflows/android-common-with-lint.yml with: build-number: ${{ needs.generate-build-number.outputs.build-number }} + lfs: ${{ inputs.lfs }} secrets: inherit android-bundle: @@ -36,6 +41,8 @@ jobs: needs: [generate-build-number, branch] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main with: diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 3bdb2aa..9cec9ab 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -2,7 +2,12 @@ name: Release Workflow on: workflow_call: - workflow_dispatch: + inputs: + lfs: + description: 'Whether to use LFS for the artifacts' + type: boolean + default: false + env: ENVIRONMENT_FILE: .env @@ -19,7 +24,7 @@ jobs: steps: - name: Generate Build Number id: build-number-generator - run: | + run: | build_number=$(date +%s) echo "build-number=$build_number" >> $GITHUB_OUTPUT echo "Build Number: $build_number" @@ -28,6 +33,7 @@ jobs: needs: [generate-build-number] uses: QuickBirdEng/workflows/.github/workflows/android-common.yml@main with: + lfs: ${{ inputs.lfs }} build-number: ${{ needs.generate-build-number.outputs.build-number }} secrets: inherit @@ -36,6 +42,8 @@ jobs: needs: [generate-build-number, branch] steps: - uses: actions/checkout@v3 + with: + lfs: ${{ inputs.lfs }} - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main with: @@ -62,4 +70,4 @@ jobs: secret-key: ${{ secrets.DO_SECRET_KEY }} repo-token: ${{ secrets.GITHUB_TOKEN }} name-suffix: android - artifact-path: app/build/outputs/bundle/release/app-release.aab \ No newline at end of file + artifact-path: app/build/outputs/bundle/release/app-release.aab From 51a9f6ead4735fbbb528fe95d3729656ebb32de5 Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Tue, 6 Feb 2024 17:34:29 +0100 Subject: [PATCH 4/4] add ndk support --- .github/workflows/android-manual-release.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/android-manual-release.yml b/.github/workflows/android-manual-release.yml index 0ec53e7..7de2790 100644 --- a/.github/workflows/android-manual-release.yml +++ b/.github/workflows/android-manual-release.yml @@ -7,6 +7,10 @@ on: description: 'Whether to use LFS for the artifacts' type: boolean default: false + ndk: + description: 'Should use NDK for the build' + type: boolean + default: false env: ENVIRONMENT_FILE: .env @@ -35,6 +39,10 @@ jobs: - uses: actions/checkout@v3 with: lfs: ${{ inputs.lfs }} + - uses: nttld/setup-ndk@v1 + if: ${{ inputs.ndk == true }} + with: + ndk-version: r25c - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main with: @@ -67,6 +75,10 @@ jobs: - uses: actions/checkout@v3 with: lfs: ${{ inputs.lfs }} + - uses: nttld/setup-ndk@v1 + if: ${{ inputs.ndk == true }} + with: + ndk-version: r25c - run: echo "BuildForRelease=true" >> $GITHUB_ENV - uses: QuickBirdEng/actions/setup-version@main with: