|
| 1 | +name: Android Build and Deploy (Internal) |
| 2 | + |
| 3 | +env: |
| 4 | + # The name of the main module repository |
| 5 | + main_project_module: app |
| 6 | + |
| 7 | + # The name of the Play Store |
| 8 | + playstore_name: Code Wallet |
| 9 | + |
| 10 | +on: |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + deploy: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@master |
| 20 | + |
| 21 | + - name: Setup Java env |
| 22 | + uses: actions/setup-java@v3 |
| 23 | + with: |
| 24 | + java-version: '17' |
| 25 | + distribution: 'corretto' |
| 26 | + cache: 'gradle' |
| 27 | + |
| 28 | + - name: Setup Ruby env |
| 29 | + uses: ruby/setup-ruby@v1 |
| 30 | + with: |
| 31 | + ruby-version: 2.7.2 |
| 32 | + bundler-cache: true |
| 33 | + |
| 34 | + - name: Decode Google Services JSON file |
| 35 | + uses: timheuer/base64-to-file@v1 |
| 36 | + id: google_services_json_file |
| 37 | + with: |
| 38 | + fileName: google-services.json |
| 39 | + fileDir: ./app/src |
| 40 | + encodedString: ${{ secrets.GOOGLE_SERVICES_JSON }} |
| 41 | + |
| 42 | + - name: Decode Service Account Key JSON file |
| 43 | + uses: timheuer/base64-to-file@v1 |
| 44 | + id: service_account_json_file |
| 45 | + with: |
| 46 | + fileName: serviceAccount.json |
| 47 | + encodedString: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON }} |
| 48 | + |
| 49 | + - name: Decode Upload Key Store file into location 1 |
| 50 | + uses: timheuer/base64-to-file@v1 |
| 51 | + with: |
| 52 | + fileName: key |
| 53 | + fileDir: ./key |
| 54 | + encodedString: ${{ secrets.UPLOAD_KEY_STORE }} |
| 55 | + |
| 56 | + - name: Decode Upload Key Store file into location 2 |
| 57 | + uses: timheuer/base64-to-file@v1 |
| 58 | + with: |
| 59 | + fileName: key |
| 60 | + fileDir: ./app/key |
| 61 | + encodedString: ${{ secrets.UPLOAD_KEY_STORE }} |
| 62 | + |
| 63 | + - name: Setup BugSnag API Key |
| 64 | + run: echo BUGSNAG_API_KEY=\"${{ secrets.BUGSNAG_API_KEY }}\" > ./local.properties |
| 65 | + |
| 66 | + - name: Setup Fingerprint API Key |
| 67 | + run: echo FINGERPRINT_API_KEY=${{ secrets.FINGERPRINT_API_KEY }} >> ./local.properties |
| 68 | + |
| 69 | + - name: Setup Google Cloud Project Number |
| 70 | + run: echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties |
| 71 | + |
| 72 | + - name: Setup Kado API Key |
| 73 | + run: echo KADO_API_KEY=\"${{ secrets.KADO_API_KEY }}\" >> ./local.properties |
| 74 | + |
| 75 | + - name: Setup Mixpanel API Key |
| 76 | + run: echo MIXPANEL_API_KEY=\"${{ secrets.MIXPANEL_API_KEY }}\" >> ./local.properties |
| 77 | + |
| 78 | + - name: Run tests |
| 79 | + run: bundle exec fastlane android test |
| 80 | + |
| 81 | + - name: Build & deploy Android release |
| 82 | + run: bundle exec fastlane android deploy_internal |
| 83 | + env: |
| 84 | + STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} |
| 85 | + KEY_ALIAS: ${{ secrets.KEY_ALIAS}} |
| 86 | + KEY_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} |
| 87 | + SERVICE_ACCOUNT_KEY_JSON: ${{ steps.service_account_json_file.outputs.filePath }} |
| 88 | + |
| 89 | + - name: Upload build artifacts |
| 90 | + uses: actions/upload-artifact@v2 |
| 91 | + with: |
| 92 | + name: assets |
| 93 | + path: | |
| 94 | + ${{ github.workspace }}/app/build/outputs/bundle/release |
0 commit comments