-
Notifications
You must be signed in to change notification settings - Fork 5
164 lines (139 loc) · 5.13 KB
/
main.yaml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Native Build & Test
env:
cacheId: '8' # increment to expire the cache
on:
pull_request:
branches: [main]
paths:
- 'packages/legacy/app/**'
- 'packages/legacy/core/**'
- 'packages/oca/**'
- '**/package-lock.json'
types: [opened, synchronize, reopened, labeled]
push:
branches: [main]
jobs:
build-ios:
runs-on: macos-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/packages/legacy/app/Gemfile
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup NodeJS
uses: ./.github/actions/setup-node
- name: Configure ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ./packages/legacy/app
- name: Cache pod dependencies
id: pod-cache
uses: actions/cache@v3
with:
path: packages/legacy/app/ios/Pods
key: ${{ runner.os }}-pods-${{ env.cacheId }}-${{ hashFiles('**/Podfile.lock ') }}
restore-keys: |
${{ runner.os }}-pods-${{ env.cacheId }}-
# Watch for changes to the `App` and `iOS` paths, use
# git for cache keys.
- name: Generate cache key
run: |
echo $(git rev-parse HEAD:packages/legacy/core/App) > ./dd-cache-key.txt
echo $(git rev-parse HEAD:packages/legacy/app/ios) >> ./dd-cache-key.txt
- name: Cache derived data
uses: actions/cache@v3
with:
path: packages/legacy/app/ios/xbuild/Build
key: ${{ runner.os }}-dd-xcode-${{ env.cacheId }}-${{ hashFiles('**/dd-cache-key.txt') }}
restore-keys: |
${{ runner.os }}-dd-xcode-${{ env.cacheId }}-
- name: Install React Native Dependencies
run: |
yarn install --immutable && \
git status
- name: Build Workspace
run: |
yarn lerna run build
- name: Install iOS dependencies
# if: steps.pod-cache.outputs.cache-hit != 'true' || steps.npm-cache.outputs.cache-hit != 'true'
working-directory: ./packages/legacy/app/ios
run: |
bundle install --frozen --gemfile=${BUNDLE_GEMFILE} && \
pod install && \
git status && \
git diff Podfile.lock
- name: Run release build
# if: steps.pod-cache.outputs.cache-hit != 'true' || steps.npm-cache.outputs.cache-hit != 'true'
working-directory: ./packages/legacy/app/ios
run: |
xcodebuild \
-workspace AriesBifold.xcworkspace \
-scheme AriesBifold \
-configuration Release \
-derivedDataPath xbuild \
build \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO
# This is a 1G file that adds little to speeding up
# the build but does impact cache size.
- name: Cleanup large artifacts
working-directory: ./packages/legacy/app/ios
run: |
rm -rf build/Build/Products/Debug-iphoneos/AriesBifold.app
build-android:
runs-on: ubuntu-latest
strategy:
matrix:
compile-sdk: [33]
build-tools: [33.0.2]
sdk-tools: [4333796]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup NodeJS
uses: ./.github/actions/setup-node
- name: setup ubuntu
run: |
sudo apt-get --quiet update --yes
sudo apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
cache: 'gradle'
- name: Setup Android SDK
working-directory: ./packages/legacy/app/android
run: |
set -x
sudo mkdir -p /root/.android
sudo touch /root/.android/repositories.cfg
export ANDROID_HOME=$PWD/android-sdk
mkdir -p $ANDROID_HOME/cmdline-tools
wget --quiet --output-document=commandlinetools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
unzip -d $ANDROID_HOME/cmdline-tools commandlinetools-linux.zip
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest
find $ANDROID_HOME -name sdkmanager
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
echo y | sdkmanager "platforms;android-${{ matrix.compile-sdk }}" >/dev/null
echo y | sdkmanager "platform-tools" >/dev/null
echo y | sdkmanager "build-tools;${{ matrix.build-tools }}" >/dev/null
find $ANDROID_HOME -type f -executable -print
chmod +x ./gradlew
set +o pipefail
yes | sdkmanager --licenses
set -o pipefail
- name: Install React Native Dependencies
run: |
node -v && yarn -v && yarn install --immutable && \
git status
- name: Build Workspace
run: |
yarn lerna run build
- name: Android Release Build
working-directory: ./packages/legacy/app/android
run: ./gradlew --no-daemon bundleRelease