Skip to content

Commit

Permalink
feat: Expo Update support + Inspector Beta + CLI / SDK refactor (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Dawid Krajewski <[email protected]>
Co-authored-by: Sherlo Bot <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent 6c8b2b1 commit 15f0ebb
Show file tree
Hide file tree
Showing 549 changed files with 33,825 additions and 108,620 deletions.
126 changes: 0 additions & 126 deletions .github/workflows/async.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/device_testing.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Sherlo with EAS hooks
name: TEST - expo-cloud-builds mode

on:
workflow_call:
Expand All @@ -7,16 +7,26 @@ on:
description: 'Environment (dev, test, prod)'
required: true
type: string
use_github_action:
description: 'Use Sherlo Github Action'
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
env:
description: 'Environment (dev, test, prod)'
required: true
default: 'dev'
type: string
use_github_action:
description: 'Use Sherlo Github Action'
required: false
type: boolean
default: false

jobs:
start_sherlo_and_make_builds_with_eas:
start_sherlo_expo_cloud:
if: >
(github.event_name == 'pull_request' && github.event.action == 'labeled' && startsWith(github.event.label.name, 'sherlo:eas')) ||
(github.event_name != 'pull_request')
Expand All @@ -42,14 +52,25 @@ jobs:

# It's important to run Sherlo in the same job as the EAS build,
# because we're pushing temporary files to .expo directory used during the build
- name: Run Sherlo in async mode
- name: Run sherlo expo-cloud-builds with CLI
if: inputs.use_github_action == false
working-directory: testing/expo-storybook-8
run: |
yarn sherlo expo-cloud-builds \
--waitForEasBuild \
--config ../../configs/default-devices.json \
--token ${{ secrets.SHERLO_EXPO_CLOUD_TOKEN }}
- name: Run sherlo expo-cloud-builds with Github Action
if: inputs.use_github_action == true
uses: ./.
with:
command: expo-cloud-builds
projectRoot: testing/expo-storybook-8
config: ../../configs/eas.preview.json
remoteExpo: true
waitForEasBuild: true
config: ../../configs/default-devices.json
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_INTEGRATION_TESTING_EAS_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_EXPO_CLOUD_TOKEN }}

- name: Trigger EAS builds for both platforms
working-directory: testing/expo-storybook-8
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/expo-remote-builds.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/workflows/expo-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: TEST - expo-update mode

on:
workflow_call:
inputs:
env:
description: 'Environment (dev, test, prod)'
required: true
type: string
config:
description: 'Config (default-devices, all-devices, many-stories)'
required: false
default: 'default-devices'
type: string
use_github_action:
description: 'Use Sherlo Github Action'
required: false
default: false
type: boolean
project:
description: 'Project (expo-update, device-testing, many-stories)'
required: true
type: string
with_builds:
description: 'With builds'
required: false
default: false
type: boolean

jobs:
run_sherlo_expo_update:
name: Run Sherlo in expo-update mode
environment: ${{ inputs.env }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
lfs: true

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.18.0'

- name: Install dependencies
run: yarn

- name: Build dependencies
run: yarn switch-env:${{ inputs.env }}
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Trigger EAS update and capture manifest URLs
working-directory: testing/expo-storybook-8
run: |
eas update --channel 'development' --message 'Expo Update' --json --non-interactive
- name: Run sherlo expo-update (with native builds) with CLI
if: inputs.with_builds == true && inputs.use_github_action == false
working-directory: testing/expo-storybook-8
run: |
yarn sherlo expo-update \
--config ../../configs/${{ inputs.config }}.json \
--android builds/development/android.apk \
--ios builds/development/ios.tar.gz \
--branch development \
--token ${{ inputs.project == 'expo-update' && secrets.SHERLO_EXPO_UPDATE_TOKEN || inputs.project == 'many-stories' && secrets.SHERLO_MANY_STORIES_TOKEN || inputs.project == 'device-testing' && secrets.SHERLO_ALL_DEVICES_TOKEN }}
- name: Run sherlo expo-update (with native builds) with Github Action
if: inputs.with_builds == true && inputs.use_github_action == true
uses: ./.
with:
command: expo-update
projectRoot: testing/expo-storybook-8
config: ../../configs/${{ inputs.config }}.json
android: builds/development/android.apk
ios: builds/development/ios.tar.gz
branch: development
env:
SHERLO_TOKEN: ${{ inputs.project == 'expo-update' && secrets.SHERLO_EXPO_UPDATE_TOKEN || inputs.project == 'many-stories' && secrets.SHERLO_MANY_STORIES_TOKEN || inputs.project == 'device-testing' && secrets.SHERLO_ALL_DEVICES_TOKEN }}

- name: Run sherlo expo-update (without native builds) with CLI
if: inputs.with_builds == false && inputs.use_github_action == false
working-directory: testing/expo-storybook-8
run: |
yarn sherlo expo-update \
--config ../../configs/${{ inputs.config }}.json \
--branch development \
--token ${{ inputs.project == 'expo-update' && secrets.SHERLO_EXPO_UPDATE_TOKEN || inputs.project == 'many-stories' && secrets.SHERLO_MANY_STORIES_TOKEN || inputs.project == 'device-testing' && secrets.SHERLO_ALL_DEVICES_TOKEN }}
- name: Run sherlo expo-update (without native builds) with Github Action
if: inputs.with_builds == false && inputs.use_github_action == true
uses: ./.
with:
command: expo-update
projectRoot: testing/expo-storybook-8
config: ../../configs/${{ inputs.config }}.json
branch: development
env:
SHERLO_TOKEN: ${{ inputs.project == 'expo-update' && secrets.SHERLO_EXPO_UPDATE_TOKEN || inputs.project == 'many-stories' && secrets.SHERLO_MANY_STORIES_TOKEN || inputs.project == 'device-testing' && secrets.SHERLO_ALL_DEVICES_TOKEN }}
Loading

0 comments on commit 15f0ebb

Please sign in to comment.