Skip to content

Commit

Permalink
add worfklow token passings
Browse files Browse the repository at this point in the history
  • Loading branch information
michalziolkowski committed Mar 26, 2024
1 parent fc4fce5 commit 289d213
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: true
type: string
description: 'Build profile to use (development, preview, production)'
EXPO_TOKEN:
description: 'EXPO_TOKEN'
required: true
type: string

jobs:
android_build:
Expand Down Expand Up @@ -46,7 +50,7 @@ jobs:
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
token: ${{ secrets.EXPO_TOKEN || inputs.EXPO_TOKEN }}

- name: Build Android example app
if: ${{ !inputs.skip_build }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: true
type: string
description: 'Build profile to use (development, preview, production)'
EXPO_TOKEN:
description: 'EXPO_TOKEN'
required: true
type: string

jobs:
ios_build:
Expand Down Expand Up @@ -55,7 +59,7 @@ jobs:
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
token: ${{ secrets.EXPO_TOKEN || inputs.EXPO_TOKEN }}

- name: Build iOS example app
if: ${{ !inputs.skip_build }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/run_sherlo_async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: false
default: false
type: boolean
SHERLO_TOKEN:
description: 'SHERLO_TOKEN'
required: true
type: string
workflow_dispatch:
inputs:
skip_build:
Expand Down Expand Up @@ -52,7 +56,7 @@ jobs:
projectRoot: examples/expo-example
asyncUpload: true
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN || inputs.SHERLO_TOKEN }}

## Android
android_preview_build:
Expand Down Expand Up @@ -96,7 +100,7 @@ jobs:
android: builds/preview/android.apk
asyncUploadBuildIndex: ${{ needs.run_sherlo_async.outputs.buildIndex }}
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN || inputs.SHERLO_TOKEN }}

## iOS
ios_preview_build:
Expand Down Expand Up @@ -140,4 +144,4 @@ jobs:
ios: builds/preview/ios.tar.gz
asyncUploadBuildIndex: ${{ needs.run_sherlo_async.outputs.buildIndex }}
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN || inputs.SHERLO_TOKEN }}
13 changes: 11 additions & 2 deletions .github/workflows/run_sherlo_eas_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ on:
branches: [dev]
types: [labeled]
workflow_call:
inputs:
EXPO_TOKEN:
description: 'EXPO_TOKEN'
required: true
type: string
SHERLO_TOKEN:
description: 'SHERLO_TOKEN'
required: true
type: string
workflow_dispatch:

jobs:
Expand All @@ -27,15 +36,15 @@ jobs:
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
token: ${{ secrets.EXPO_TOKEN || inputs.EXPO_TOKEN }}

- name: Run Sherlo with Async Upload
uses: ./.
with:
projectRoot: examples/expo-example
asyncUpload: true
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN || inputs.SHERLO_TOKEN }}

- name: Trigger EAS builds for both platforms
run: eas build --profile=preview --non-interactive --no-wait
6 changes: 5 additions & 1 deletion .github/workflows/run_sherlo_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: false
default: false
type: boolean
SHERLO_TOKEN:
description: 'SHERLO_TOKEN'
required: true
type: string
workflow_dispatch:
inputs:
skip_build:
Expand Down Expand Up @@ -82,4 +86,4 @@ jobs:
android: examples/expo-example/builds/preview/android.apk
config: examples/expo-example/sherlo.config.json
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN || inputs.SHERLO_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,29 @@ jobs:
uses: sherlo-io/sherlo/.github/workflows/update_builds.yml@michal/eas-build-hooks
with:
profile: 'preview'
SHERLO_BOT_APP_ID: ${{ secrets.SHERLO_BOT_APP_ID }}
SHERLO_BOT_PRIVATE_KEY: ${{ secrets.SHERLO_BOT_PRIVATE_KEY }}
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}

run_sherlo_sync_tests:
if: ${{ github.event.inputs.run_sherlo_sync_tests || github.event_name == 'push' }}
needs: [update_builds]
uses: sherlo-io/sherlo/.github/workflows/run_sherlo_sync.yml@michal/eas-build-hooks
with:
skip_build: true
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}

run_sherlo_async_tests:
if: ${{ github.event.inputs.run_sherlo_async_tests || github.event_name == 'push' }}
needs: [update_builds]
uses: sherlo-io/sherlo/.github/workflows/run_sherlo_async.yml@michal/eas-build-hooks
with:
skip_build: true
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}

run_sherlo_eas_hooks_tests:
if: ${{ github.event.inputs.run_sherlo_eas_hooks_tests || github.event_name == 'push' }}
uses: sherlo-io/sherlo/.github/workflows/run_sherlo_eas_hooks.yml@michal/eas-build-hooks
with:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/update_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ on:
required: true
type: string
description: 'Build profile to use (development, preview, production)'
SHERLO_BOT_APP_ID:
description: 'SHERLO_BOT_APP_ID'
required: true
type: string
SHERLO_BOT_PRIVATE_KEY:
description: 'SHERLO_BOT_PRIVATE_KEY'
required: true
type: string
EXPO_TOKEN:
description: 'EXPO_TOKEN'
required: true
type: string
workflow_dispatch:
inputs:
profile:
Expand All @@ -19,11 +31,13 @@ jobs:
uses: ./.github/workflows/android_build.yml
with:
profile: ${{ github.event.inputs.profile || inputs.profile }}
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN || inputs.EXPO_TOKEN }}

ios_build:
uses: ./.github/workflows/ios_build.yml
with:
profile: ${{ github.event.inputs.profile || inputs.profile }}
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN || inputs.EXPO_TOKEN }}

update_in_repo:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 289d213

Please sign in to comment.