From ff4fec834bb19de4a934e27e218804f89f144465 Mon Sep 17 00:00:00 2001 From: Marcel Bokhorst Date: Mon, 30 Oct 2023 19:53:37 +0100 Subject: [PATCH] Create android.yml --- .github/workflows/android.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000000..eb7c4ccef8 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,53 @@ +name: Android CI + +on: + workflow_dispatch: + inputs: + password: + description: 'Password' + required: true + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + #https://github.com/actions/runner/issues/643 + - name: Mask password + run: | + INP_PASSWORD=$(jq -r '.inputs.password' $GITHUB_EVENT_PATH) + echo ::add-mask::$INP_PASSWORD + echo PASSWORD="$INP_PASSWORD" >> $GITHUB_ENV + + #https://stefma.medium.com/how-to-store-a-android-keystore-safely-on-github-actions-f0cef9413784 + #gpg -c --armor --s2k-mode 3 --s2k-digest-algo SHA256 --s2k-count 10000000 --cipher-algo AES-256 + - name: Decrypt secrets + run: | + echo "${{ secrets.KEYSTORE }}" > keystore.asc + gpg -d --passphrase "${PASSWORD}" --batch keystore.asc > Android.keystore + echo "${{ secrets.KEYSTORE_PROPERTIES }}" > keystore.properties.asc + gpg -d --passphrase "${PASSWORD}" --batch keystore.properties.asc > keystore.properties + echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties.asc + gpg -d --passphrase "${PASSWORD}" --batch local.properties.asc > local.properties + - name: + run: | + pwd + ls + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew assembleGithubRelease assembleLargeRelease assemblePlayRelease uploadBugsnagGithub-releaseMapping uploadBugsnagLarge-releaseMapping uploadBugsnagPlay-releaseMapping + - name: Upload to BitBucket + run: | + ./gradlew upload -Ptarget=play-preview + ./gradlew upload -Ptarget=large-update + ./gradlew upload -Ptarget=github-update