Skip to content

Extract common logic for sample app building Fastlane lanes #16

Extract common logic for sample app building Fastlane lanes

Extract common logic for sample app building Fastlane lanes #16

name: Build sample app for SDK release
on:
workflow_dispatch:
push:
branches:
- MBL-553-build-sample-app-for-sdk-release
jobs:
build-sample-app:
runs-on: ubuntu-latest
name: Build sample app
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: MBL-553-build-sample-app-for-sdk-release
fetch-depth: 0 # Workaround for bug https://github.com/actions/checkout/issues/1471
- name: Get latest SDK version
id: latest-sdk-version-step
run: |
latest_tag=$(git describe --tags --abbrev=0)
echo "LATEST_TAG=$latest_tag" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/setup-android
- name: Install Ruby used by Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Setup local.properties file for sample app
env:
SDK_VERSION: ${{ steps.latest-sdk-version-step.outputs.LATEST_TAG }}
run: |
touch "samples/local.properties"
echo "cdpApiKey=${{ secrets.CUSTOMERIO_JAVA_WORKSPACE_CDP_API_KEY }}" >> "samples/local.properties"
echo "siteId=${{ secrets.CUSTOMERIO_JAVA_WORKSPACE_SITE_ID }}" >> "samples/local.properties"
echo "sdkVersion=${{ env.SDK_VERSION }}" >> "samples/local.properties"
- name: Deploy development build via Fastlane
uses: maierj/[email protected]
with:
lane: 'android build_sample_app_for_sdk_release'
subdirectory: "samples/java_layout"
options: '{ "sdk_version": "${{ env.SDK_VERSION }}" }'
env:
ANDROID_SIGNING_ALIAS: ${{ secrets.ANDROID_SIGNING_ALIAS }}
ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
ANDROID_SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64 }}
SDK_VERSION: ${{ steps.latest-sdk-version-step.outputs.LATEST_TAG }}