Build Example Apps & Run Sherlo #72
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 Example Apps & Run Sherlo | |
on: | |
workflow_dispatch: | |
inputs: | |
MAKE_BUILDS: | |
description: 'Make new preview builds' | |
type: boolean | |
required: true | |
default: true | |
branches: | |
- '**' | |
jobs: | |
android_preview_build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up Node.js | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.18.0' | |
- name: Setup Java Environment | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Install dependencies | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
run: yarn | |
- name: Build dependencies | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
run: yarn build | |
- name: Setup EAS | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: Build Android example app | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
run: yarn workspace @sherlo/expo-example android:preview | |
- name: Upload Android Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: android-preview | |
path: examples/expo-example/.builds/preview/android.apk | |
ios_preview_build: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up Node.js | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.18.0' | |
- name: Select Xcode Version | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.0.1' | |
- run: | | |
xcode-select -print-path | |
- run: | | |
xcodebuild -version | |
- name: Setup Cocoapods | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
version: latest | |
- name: Install dependencies | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
run: yarn | |
- name: Build dependencies | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
run: yarn build | |
- name: Setup EAS | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: Build iOS example app | |
if: ${{ github.event.inputs.MAKE_BUILDS == 'true' }} | |
run: yarn workspace @sherlo/expo-example ios:preview | |
- name: Upload iOS Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ios-preview | |
path: examples/expo-example/.builds/preview/ios.tar.gz | |
run_sherlo_action: | |
runs-on: ubuntu-latest | |
needs: [android_preview_build, ios_preview_build] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Download Android Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: android-preview | |
path: ci-builds | |
- name: Download iOS Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: ios-preview | |
path: ci-builds | |
- name: Run Sherlo Action | |
uses: ./. | |
with: | |
ios: ci-builds/ios.tar.gz | |
android: ci-builds/android.apk | |
config: examples/expo-example/sherlo.config.json | |
env: | |
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }} |