Skip to content

Android Build & Deploy #1

Android Build & Deploy

Android Build & Deploy #1

name: Android Build & Deploy
on:
workflow_dispatch:
# push:
# branches: ["dev"]
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
ruby-version: [3.3]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: "Set login password for downloading mapbox SDK"
uses: extractions/netrc@v2
with:
machine: api.mapbox.com
username: mapbox
password: ${{ secrets.MAPBOX_SDK_REGISTRY_TOKEN }}
- run: npm ci
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: android
- name: Run tests
run: bundle exec fastlane android test
- name: Decode Service Account Key JSON File
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: "serviceAccount.json"
encodedString: ${{ secrets.GPLAY_SERVICE_ACCOUNT_KEY_JSON }}
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "android_keystore.keystore"
encodedString: ${{ secrets.KEYSTORE_FILE }}
- name: Build & deploy Android release
run: bundle exec fastlane android deploy
env:
KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS}}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: assets
path: |
${{ github.workspace }}/android/app/build/outputs/bundle/release