From 42636ffa256ac2c1c17d0060340128815445c608 Mon Sep 17 00:00:00 2001 From: Xtr126 Date: Sat, 27 Jul 2024 16:33:11 +0530 Subject: [PATCH] Update workflows --- .github/workflows/build-apk.yml | 46 +++++++++++++++++++ .../{release.yml => release-apk.yml} | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-apk.yml rename .github/workflows/{release.yml => release-apk.yml} (97%) diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml new file mode 100644 index 00000000..4fc635ea --- /dev/null +++ b/.github/workflows/build-apk.yml @@ -0,0 +1,46 @@ +name: Build and Upload APK + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + + build: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Write key + run: | + if [ ! -z "${{ secrets.KEYSTORE }}" ]; then + { + echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' + echo keyPassword='${{ secrets.KEY_PASSWORD }}' + echo keyAlias='${{ secrets.KEY_ALIAS }}' + echo storeFile='../keystore.jks' + } > keystore.properties + echo '${{ secrets.KEYSTORE }}' | base64 -d > keystore.jks + fi + + - name: Build with Gradle + run: ./gradlew app:assembleRelease + + - uses: actions/upload-artifact@v4 + with: + name: my-artifact + path: app/build/outputs/apk/release/XtMapper-universal-release-v2.1.5.apk + diff --git a/.github/workflows/release.yml b/.github/workflows/release-apk.yml similarity index 97% rename from .github/workflows/release.yml rename to .github/workflows/release-apk.yml index 70268798..a423820d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-apk.yml @@ -52,7 +52,7 @@ jobs: mv ./github-pages ./app/src/main/assets/XtMapper-docs - name: Build with Gradle - run: ./gradlew assembleRelease + run: ./gradlew app:assembleRelease - name: Release uses: "marvinpinto/action-automatic-releases@latest"