-
-
Notifications
You must be signed in to change notification settings - Fork 11
143 lines (115 loc) · 3.82 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
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
142
143
name: Build example
on:
push:
paths-ignore:
- '**/*.md'
branches:
- main
defaults:
run:
working-directory: example
jobs:
# Create example build for Android
build-apk:
name: Build Android APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup Web environment to install packages.
- name: Setup Web environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
# Setup Java environment in order to build the Android app.
- name: Setup Java 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
generate-job-summary: false
- name: Install plugin packages
working-directory: .
run: yarn install --frozen-lockfile
- name: Build the plugin
working-directory: .
run: yarn build
- name: Install example packages
run: yarn install --frozen-lockfile
- name: Build the example project
run: yarn build
- name: Sync to copy web assets into the platform
run: npx cap sync android
- name: Build Android debug APK
working-directory: example/android
run: ./gradlew assembleDebug
- name: Save apk file as artifact
uses: actions/upload-artifact@v3
with:
name: cap_safearea_plugin_example_android
path: example/android/app/build/outputs/apk/debug/app-debug.apk
# Build iOS .app build that can drag and dropped into a iOS simulator
build-ios-simulator:
name: Create an iOS Simulator build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
# Setup Web environment to install packages.
- name: Setup Web environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
# improve iOS build compilation time
- name: Restore buildcache
uses: mikehardy/buildcache-action@v2
continue-on-error: true
- name: Restore Pods cache
uses: actions/cache@v3
with:
path: |
ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-
- name: Install plugin packages
working-directory: .
run: yarn install --frozen-lockfile
- name: Build the plugin
working-directory: .
run: yarn build
- name: Install example packages
run: yarn install --frozen-lockfile
- name: Build the example project
run: yarn build
- name: Sync to copy web assets into the platform
run: npx cap sync ios
- name: Install xcpretty
run: gem install xcpretty
- name: Run simulator build command
working-directory: example/ios/App
run: |
set -o pipefail
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-scheme App \
-workspace App.xcworkspace \
-sdk iphonesimulator \
-configuration Release \
-derivedDataPath build | xcpretty
- name: Store build .app file as zip
working-directory: example/ios/App
run: |
cd build/Build/Products/Release-iphonesimulator
mv App.app safearea_plugin_example_ios.app
mkdir -p output
zip -r -y -o output/safearea_plugin_example_ios.zip safearea_plugin_example_ios.app
- name: Save build file as artifact
uses: actions/upload-artifact@v3
with:
name: cap_safearea_plugin_example_ios
path: example/ios/App/build/Build/Products/Release-iphonesimulator/output