|
| 1 | +name: Android Staging Build |
| 2 | + |
| 3 | +# Manual deployment |
| 4 | +on: workflow_dispatch |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-and-publish: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + environment: staging |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v4 |
| 12 | + |
| 13 | + - uses: actions/setup-node@v4 |
| 14 | + with: |
| 15 | + cache: 'yarn' |
| 16 | + node-version-file: .node-version |
| 17 | + |
| 18 | + - name: Setup Java |
| 19 | + uses: actions/setup-java@v3 |
| 20 | + with: |
| 21 | + distribution: temurin |
| 22 | + java-version: 17 |
| 23 | + |
| 24 | + - name: Make .env file |
| 25 | + uses: SpicyPizza/[email protected] |
| 26 | + with: |
| 27 | + envkey_BASE_API_URL: ${{ vars.BASE_API_URL }} |
| 28 | + envkey_AUTH_STORAGE_KEY: ${{ vars.AUTH_STORAGE_KEY }} |
| 29 | + envkey_DEFAULT_LOCALE: ${{ vars.DEFAULT_LOCALE }} |
| 30 | + envkey_MOCK_API: ${{ vars.MOCK_API }} |
| 31 | + |
| 32 | + # Update Google Service File |
| 33 | + # - name: Setup Firebase File |
| 34 | + # run: echo "${{ secrets.PROD_ANDROID_FIREBASE_FILE }}" > ./android/app/google-services.json |
| 35 | + |
| 36 | + # Setup Production Keystore file |
| 37 | + # - name: Setup Keystore File |
| 38 | + # run: echo "${{secrets.ANDROID_KEYSTORE_FILE}}" | base64 -d > "${{ github.workspace }}/production.keystore" |
| 39 | + |
| 40 | + # Setup Firebase Service Account file |
| 41 | + # - name: Setup Service Account Credential Files |
| 42 | + # run: echo "${{secrets.FIREBASE_SERVICE_ACCOUNT_JSON}}" > "${{ github.workspace }}/firebase-service-account.json" |
| 43 | + |
| 44 | + - name: Install |
| 45 | + run: yarn install --frozen-lockfile |
| 46 | + |
| 47 | + - name: Setup Ruby |
| 48 | + uses: ruby/setup-ruby@v1 |
| 49 | + with: |
| 50 | + ruby-version: '3.2' |
| 51 | + bundler-cache: true |
| 52 | + |
| 53 | + - name: Setup Git Config |
| 54 | + run: | |
| 55 | + git config user.name "GitHub Actions Bot" |
| 56 | + git config user.email "<>" |
| 57 | +
|
| 58 | + - name: Build and Upload to Firebase |
| 59 | + |
| 60 | + with: |
| 61 | + lane: 'android staging' |
| 62 | + env: |
| 63 | + # ANDROID_KEYSTORE_FILE: '${{ github.workspace }}/production.keystore' |
| 64 | + # ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} |
| 65 | + # ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} |
| 66 | + FIREBASE_ANDROID_APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }} |
| 67 | + # Not required if you define service_credentials_file in the Fastfile |
| 68 | + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |
| 69 | + |
| 70 | + - name: Archive build |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: staging_apk |
| 74 | + path: android/app/build/outputs/apk/**/*.apk |
0 commit comments