chore: Create workflow to build sample app with latest SDK release #865
Workflow file for this run
This file contains 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 sample apps | |
on: | |
pull_request: # build sample apps for every commit pushed to an open pull request (including drafts) | |
push: | |
branches: [ main, feature/* ] | |
release: # build sample apps for every git tag created. These are known as "stable" builds that are suitable for people outside the mobile team. | |
types: [ published ] | |
concurrency: # cancel previous workflow run if one exists. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update-pr-comment: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write # to be able to comment on PR | |
outputs: | |
comment-id: ${{ steps.create-comment.outputs.comment-id }} | |
steps: | |
- name: Find Comment | |
uses: peter-evans/find-comment@v3 | |
id: existing-comment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: <!-- sample app builds --> | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v4 | |
id: create-comment | |
with: | |
comment-id: ${{ steps.existing-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
<!-- sample app builds --> | |
# Sample app builds 📱 | |
Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. | |
--- | |
${{ steps.build.outputs.build-log }} | |
edit-mode: replace # replace the existing comment with new content since we are creating new builds | |
build-sample-apps: | |
if: ${{ always() }} # do not skip running this step if update-pr-comment does not run | |
needs: [ update-pr-comment ] # wait for PR comment to be created saying new builds are being made. | |
uses: ./.github/workflows/reusable_build_sample_apps.yml | |
with: | |
use_latest_sdk_version: false | |
secrets: | |
CUSTOMERIO_JAVA_WORKSPACE_CDP_API_KEY: ${{ secrets.CUSTOMERIO_JAVA_WORKSPACE_CDP_API_KEY }} | |
CUSTOMERIO_JAVA_WORKSPACE_SITE_ID: ${{ secrets.CUSTOMERIO_JAVA_WORKSPACE_SITE_ID }} | |
CUSTOMERIO_KOTLIN_WORKSPACE_CDP_API_KEY: ${{ secrets.CUSTOMERIO_KOTLIN_WORKSPACE_CDP_API_KEY }} | |
CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID: ${{ secrets.CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID }} | |
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 }} | |