Create keys.xml #5
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: Build Bits & Bytes demo/variant debug Build (Develop) | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| pull_request: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to run the workflow on' | |
| default: 'develop' | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Update signingConfigs in build.gradle.kts | |
| run: | | |
| sed -i '/signingConfigs {/,/}/c\signingConfigs {\n\n getByName("debug") {\n keyAlias = "${{ secrets.BITS_N_BYTES_DEBUG_KEY_ALIAS }}"\n keyPassword = "${{ secrets.BITS_N_BYTES_DEBUG_KEY_PASSWORD }}"\n storeFile = file("keystore/debug")\n storePassword = "${{ secrets.BITS_N_BYTES_DEBUG_STORE_PASSWORD }}"\n }\n' app/build.gradle.kts | |
| - name: Change API key in demo keys.xml | |
| run: | | |
| sed -i 's|<string name="com.sap.cxcdc.apikey">.*</string>|<string name="com.sap.cxcdc.apikey">${{ secrets.BITS_N_BYTES_DEMO_API_KEY }}</string>|' app/src/main/res/values/keys.xml | |
| - name: Change API key in variant keys.xml | |
| run: | | |
| sed -i 's|<string name="com.sap.cxcdc.apikey">.*</string>|<string name="com.sap.cxcdc.apikey">${{ secrets.BITS_N_BYTES_DEMO_API_KEY }}</string>|' app/src/variant/res/values/keys.xml | |
| - name: Create file for google-services.json (Demo) | |
| run: cat app/google-services.json | base64 | |
| - name: Populate google-services.json (Demo) | |
| env: | |
| DATA: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| run: echo $DATA > app/google-services.json | |
| - name: Build Debug APK | |
| run: ./gradlew assembleDebug | |
| - name: Rename Demo APK file | |
| run: mv app/build/outputs/apk/demo/debug/app-demo-debug.apk app/build/outputs/apk/demo/debug/bits-n-bytes-app-demo-debug.apk | |
| - name: Rename Variant APK file | |
| run: mv app/build/outputs/apk/variant/debug/app-variant-debug.apk app/build/outputs/apk/variant/debug/bits-n-bytes-app-variant-debug.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: demo-debug-apk | |
| path: app/build/outputs/apk/demo/debug/bits-n-bytes-app-demo-debug.apk | |
| - name: Upload Variant APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: variant-debug-apk | |
| path: app/build/outputs/apk/variant/debug/bits-n-bytes-app-variant-debug.apk |