-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (119 loc) · 4.12 KB
/
run_sherlo_async.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Run Sherlo with Async Upload
on:
pull_request:
branches: [dev]
types: [labeled]
push:
branches: [michal/eas-build-hooks] # Add this line to trigger on push to the specified branch
workflow_dispatch:
inputs:
skip_build:
description: 'Skip the build steps'
required: false
default: 'false'
type: boolean
jobs:
## Sherlo
run_sherlo_async:
name: Run Sherlo in async mode
if: >
(github.event_name == 'pull_request' && github.event.action == 'labeled' && startsWith(github.event.label.name, 'sherlo:async')) ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'push' && github.ref == 'refs/heads/michal/eas-build-hooks')
runs-on: ubuntu-latest
outputs:
buildIndex: ${{ steps.sherlo_action.outputs.buildIndex }} # Map step output to job output
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- 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 build
- name: Run Sherlo Action with Async Upload
id: sherlo_action # This ID is used to reference the output
uses: ./.
with:
projectRoot: examples/expo-example
asyncUpload: true
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
## Android
android_preview_build:
name: Prepare Android Preview Build
needs: [run_sherlo_async]
uses: sherlo-io/sherlo/.github/workflows/android_build.yml@michal/eas-build-hooks
with:
skip_build: ${{ github.event.inputs.skip_build || github.event.label.name == 'sherlo:async:skip_build' || (github.event_name == 'push' && github.ref == 'refs/heads/michal/eas-build-hooks') }}
profile: 'preview'
android_preview_build_upload:
name: Upload Android Preview Build to Sherlo
needs: [run_sherlo_async, android_preview_build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- 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 build
- name: Download Android Artifact
uses: actions/download-artifact@v2
with:
name: android
path: examples/expo-example/builds/preview
- name: Upload Android to Sherlo
uses: ./.
with:
projectRoot: examples/expo-example
android: builds/preview/android.apk
asyncUploadBuildIndex: ${{ needs.run_sherlo_async.outputs.buildIndex }}
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}
## iOS
ios_preview_build:
name: Prepare iOS Preview Build
needs: [run_sherlo_async]
uses: sherlo-io/sherlo/.github/workflows/ios_build.yml@michal/eas-build-hooks
with:
skip_build: ${{ github.event.inputs.skip_build || github.event.label.name == 'sherlo:async:skip_build' || (github.event_name == 'push' && github.ref == 'refs/heads/michal/eas-build-hooks') }}
profile: 'preview'
ios_preview_build_upload:
name: Upload iOS Preview Build to Sherlo
needs: [run_sherlo_async, ios_preview_build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- 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 build
- name: Download iOS Artifact
uses: actions/download-artifact@v2
with:
name: ios
path: examples/expo-example/builds/preview
- name: Upload iOS to Sherlo
uses: ./.
with:
projectRoot: examples/expo-example
ios: builds/preview/ios.tar.gz
asyncUploadBuildIndex: ${{ needs.run_sherlo_async.outputs.buildIndex }}
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN }}