forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (148 loc) · 5.69 KB
/
ios.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: iOS
on:
push:
tags:
- v*
branches:
- master
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '.github/workflows/ios.yml'
pull_request:
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '!js/packages/berty-i18n/locale/*/*.json'
- '.github/workflows/ios.yml'
jobs:
build:
name: Build for iOS
runs-on: macos-latest
strategy:
matrix:
golang: ['1.16.x']
xcode: ['12.4']
node: ['14.x']
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }} # see https://github.com/actions/checkout/issues/299
- name: Setup XCode
uses: maxim-lobanov/[email protected]
with:
xcode-version: ${{ matrix.xcode }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- name: Cache Go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-v2-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.golang }}-v2-
- name: Cache Node modules
uses: actions/[email protected]
with:
path: js/node_modules
key: ${{ runner.OS }}-node-${{ matrix.node }}-v2-${{ hashFiles('js/yarn.lock') }}
restore-keys: ${{ runner.OS }}-node-${{ matrix.node }}-v2-
- name: Cache Ruby modules
uses: actions/[email protected]
with:
path: js/vendor/bundle
key: ${{ runner.OS }}-bundle-v1-${{ hashFiles('js/Gemfile.lock') }}
restore-keys: ${{ runner.OS }}-bundle-v1-
- name: Cache Gomobile .framework
uses: actions/[email protected]
with:
path: js/ios/Frameworks/Bertybridge.framework
key: ios-gomobile-${{ matrix.golang }}-v1-${{ hashFiles('go/**/*.go', 'go/**/*.m', 'go/**/*.h', 'go.sum') }}
restore-keys: ios-gomobile-${{ matrix.golang }}-v1-
- name: Cache XCodeGen
uses: actions/[email protected]
with:
path: js/vendor/xcodegen
key: ios-xcodegen-${{ matrix.xcode }}-v1-${{ hashFiles('js/XcodeGen.version') }}
restore-keys: ios-xcodegen-${{ matrix.xcode }}-v1-
- name: Cache XCode project
uses: actions/[email protected]
with:
path: js/ios/Berty.xcodeproj
key: ios-xcodeproj-${{ matrix.xcode }}-v1-${{ hashFiles('js/ios/*.yaml') }}
restore-keys: ios-xcodeproj-${{ matrix.xcode }}-v1-
- name: Cache Pods and XCode workspace
uses: actions/[email protected]
with:
path: |
js/ios/Berty.xcworkspace
js/ios/Pods
key: ios-xcodeworkspace-${{ matrix.xcode }}-v1-${{ hashFiles('js/ios/Podfile.lock', 'js/yarn.lock') }}
restore-keys: ios-xcodeworkspace-${{ matrix.xcode }}-v1-
- name: Setup macOS keychain
working-directory: tool/build/dummy-identity
run: |
security create-keychain -p "dummypass" dummy.keychain
security default-keychain -s dummy.keychain
security unlock-keychain -p "dummypass" dummy.keychain
security set-keychain-settings dummy.keychain
security import berty-dummy.p12 -t priv -f pkcs12 -P "dummypass" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "dummypass" dummy.keychain
- name: Build .env
run: cat tool/build/shakebugs-infos/env.prod >> js/.env
- name: Build pod deps
working-directory: js
run: make node_modules ios/vendor/bundle ios/Berty.xcodeproj
- name: Sync Podfile.lock
working-directory: js/ios
run: bundle exec pod install --repo-update
- name: Check diff
id: check-podfile-lock
continue-on-error: true
run: |
set -euo pipefail -o xtrace
if [[ $(git diff --text js/ios/Podfile.lock 2>&1 | tee /tmp/berty-podfile.diff) ]]; then cat /tmp/berty-podfile.diff && false; fi
- name: Build the Archive
working-directory: js
run: |
make ios.app_deps
xcodebuild archive \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_ALLOWED=NO \
ONLY_ACTIVE_ARCH=NO \
EXCLUDED_ARCHS='armv7 armv7s' \
-workspace ios/Berty.xcworkspace \
-scheme "Berty Yolo" \
-sdk iphoneos \
-archivePath /tmp/Berty.xcarchive
for lib in /tmp/Berty.xcarchive/Products/Applications/Berty\ Yolo.app/Frameworks/*.dylib; do
lipo -remove armv7 -remove armv7s "$lib" -output "$lib"
done
codesign -fs "Berty Dummy" /tmp/Berty.xcarchive/Products/Applications/Berty\ Yolo.app
mkdir Payload
mv /tmp/Berty.xcarchive/Products/Applications/Berty\ Yolo.app Payload/
zip -r ${{ github.workspace }}/Berty\ Yolo.dummy-signed-ipa Payload
- name: Upload the Archive
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/Berty Yolo.dummy-signed-ipa
name: berty-yolo-${{github.sha}}.dummy-signed-ipa
if-no-files-found: error
# mark the build as failed if a 'continue-on-error' step failed previously
- name: Check failed steps
run: false
if: ${{ steps.check-podfile-lock.outcome == 'failure' }}