Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
starry-shivam authored Jul 8, 2024
1 parent 80fcd92 commit 6c64c63
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- 'v*'
pull_request:
branches: [ "main" ]
branches: [ "main" ]

jobs:
Build:
Expand All @@ -16,16 +16,13 @@ jobs:
- name: Set GOOGLE_API_KEY in local properties
run: echo 'GOOGLE_API_KEY="${{ secrets.GOOGLE_API_KEY }}"' >> ./local.properties

- name: set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Set ANDROID_HOME
run: echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV

- name: Get Tag
id: var
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
Expand All @@ -40,15 +37,16 @@ jobs:
APK_FILE=app/build/outputs/apk/release/app-release-unsigned.apk
SIGNED_APK_FILE=app/build/outputs/apk/release/app-release-signed.apk
echo ${{ secrets.BASE64KEY }} | base64 --decode > /tmp/signingkey.jks
${ANDROID_HOME}/build-tools/$(ls ${ANDROID_HOME}/build-tools/ | tail -1)/apksigner sign \
apksigner=${ANDROID_HOME}/build-tools/$(ls ${ANDROID_HOME}/build-tools/ | tail -1)/apksigner
$apksigner sign \
--ks /tmp/signingkey.jks \
--ks-key-alias ${{ secrets.ALIAS }} \
--ks-pass pass:${{ secrets.KEY_STORE_PASSWORD }} \
--key-pass pass:${{ secrets.KEY_PASSWORD }} \
--out $SIGNED_APK_FILE \
--alignment-preserved true $APK_FILE
env:
ANDROID_HOME: ${{ env.ANDROID_HOME }}
ANDROID_HOME: ${{ env.ANDROID_HOME }}

- name: Make artifact
uses: actions/upload-artifact@v2
Expand All @@ -65,15 +63,16 @@ jobs:
AAB_FILE=app/build/outputs/bundle/release/app-release.aab
SIGNED_AAB_FILE=app/build/outputs/bundle/release/app-release-signed.aab
echo ${{ secrets.BASE64KEY }} | base64 --decode > /tmp/signingkey.jks
${ANDROID_HOME}/build-tools/$(ls ${ANDROID_HOME}/build-tools/ | tail -1)/apksigner sign \
apksigner=${ANDROID_HOME}/build-tools/$(ls ${ANDROID_HOME}/build-tools/ | tail -1)/apksigner
$apksigner sign \
--ks /tmp/signingkey.jks \
--ks-key-alias ${{ secrets.ALIAS }} \
--ks-pass pass:${{ secrets.KEY_STORE_PASSWORD }} \
--key-pass pass:${{ secrets.KEY_PASSWORD }} \
--out $SIGNED_AAB_FILE \
--alignment-preserved true $AAB_FILE
env:
ANDROID_HOME: ${{ env.ANDROID_HOME }}
ANDROID_HOME: ${{ env.ANDROID_HOME }}

- name: Make artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 6c64c63

Please sign in to comment.