-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (119 loc) · 3.88 KB
/
build_and_run_sherlo.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
140
141
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: . # This is a relative path to the action in the same repository
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 }}