-
Notifications
You must be signed in to change notification settings - Fork 6
105 lines (92 loc) · 3.14 KB
/
build.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
name: 🚀 Build and Deploy App
on:
workflow_run:
workflows: ["Lint"]
branches: [main]
types:
- completed
workflow_dispatch:
inputs:
os:
type: choice
description: OS to build on
options:
- macos-latest
- ubuntu-latest
platform:
type: choice
description: Platform to build for
options:
- android
- ios
profile:
type: choice
description: Build profile to use
options:
- development
- preview
- production
env:
platform: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.platform || vars.DEFAULT_PLATFORM }}
profile: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.profile ||vars.DEFAULT_PROFILE }}
jobs:
build:
name: 🚀 Build and Deploy App
runs-on: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.os ||vars.DEFAULT_OS }}
strategy:
matrix:
node: [18.x]
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"
#Select your required version
- name: 🏗 Select Xcode 15.2
run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- name: 🏗 Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Log dir
shell: bash
run: |
ls
- name: 🏎️ Cache Pods
if: runner.os == 'macOS'
uses: actions/cache@v3
id: pods-cache
with:
path: /apps/expo/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('/apps/expo/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: 🛠️ Setup Bun
uses: oven-sh/setup-bun@v1
- name: 🛠️ Install dependencies
run: bun install
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 👷 Build packages
run: "bun run build"
- name: 👷 Build app
working-directory: apps/expo
run: |
eas build --local \
--non-interactive \
--output=./app-${{ env.platform }}-${{ env.profile }}.${{ env.platform == 'android' && 'apk' || 'ipa' }} \
--platform=${{ env.platform }} \
--profile=${{ env.profile }}
- name: 📱 Upload binary
uses: actions/upload-artifact@v2
with:
name: app-${{ env.platform }}-${{ env.profile }}.${{ env.platform == 'android' && 'apk' || 'ipa' }}
path: ${{ github.workspace }}/apps/expo/app-${{ env.platform }}-${{ env.profile }}.${{ env.platform == 'android' && 'apk' || 'ipa' }}
- name: 🚀 Submit to Store
working-directory: apps/expo
if: env.profile == 'production'
run: |
eas submit --platform=${{ env.platform }} --non-interactive --path=./app-${{ env.platform }}-${{ env.profile }}.${{ env.platform == 'android' && 'apk' || 'ipa' }}