test #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: workflow_dispatch | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: test | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'oracle' | |
| java-version: 17 | |
| - name: Decode Keystore | |
| env: | |
| ENCODED_STRING: ${{ secrets.ANDROID_SIGNING_KEY }} | |
| ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| run: | | |
| echo $ENCODED_STRING > keystore-b64.txt | |
| base64 -d keystore-b64.txt > ../keystore.jks | |
| # 1 build apk with internet permission | |
| - name: Build | |
| env: | |
| ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| run: ./gradlew assembleRelease | |
| # 1.1 move the apk and the mapping.txt to ./ | |
| - name: move the apk | |
| run: mv app/build/outputs/apk/release/app-release.apk ./app-release.apk | |
| - name: Compress mapping.txt | |
| run: tar zcvf debug.symbol.tar.gz app/build/outputs/mapping/release/mapping.txt | |
| # 2. build apk without internet permission | |
| - name: Remove internet permission from manifest | |
| run: sed -i '/android.permission.INTERNET/d' app/src/main/AndroidManifest.xml | |
| - name: Build | |
| env: | |
| ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| run: ./gradlew assembleRelease | |
| # 2.1. move the signed apk to ./ | |
| - name: move the apk | |
| run: mv app/build/outputs/apk/release/app-release.apk ./app-release-without-internet-permission.apk | |
| # upload apks | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release.apk | |
| path: ./app-release.apk | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mapping.txt | |
| path: ./debug.symbol.tar.gz | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release-without-intnernet-permission.apk | |
| path: ./app-release-without-internet-permission.apk |