-
Notifications
You must be signed in to change notification settings - Fork 7
109 lines (97 loc) · 5.33 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
name: Build
on:
push:
branches:
- main
- cibuild
jobs:
build-apple-arm64:
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Cache gmp build
uses: actions/cache@v3
with:
path: |
depends/gmp
depends/gmp-6.2.1.tar.xz
key: ${{ runner.os }}-witnesscalc-gmp-apple-arm64-${{ hashFiles('build_gmp.sh') }}
- name: install dependencies
run: |
brew install nasm
- name: build gmp
run: |
if [[ ! -d "depends/gmp/package" ]]; then ./build_gmp.sh host; fi
if [[ ! -d "depends/gmp/package_ios_arm64" ]]; then ./build_gmp.sh ios; fi
if [[ ! -d "depends/gmp/package_iphone_simulator" ]]; then ./build_gmp.sh ios_simulator; fi
- name: build
run: |
mkdir build_witnesscalc && cd build_witnesscalc
cmake .. -DTARGET_PLATFORM=arm64_host -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package
make -j8 -vvv
make install
cd ../
mkdir build_witnesscalc_ios && cd build_witnesscalc_ios
cmake .. -GXcode -DTARGET_PLATFORM=IOS -DCMAKE_INSTALL_PREFIX=../package_ios
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_authV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQueryMTPV2OnChainStatic
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQueryMTPV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQuerySigV2OnChainStatic
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQuerySigV2Static
mkdir -p ../package_ios/lib
cp ../depends/gmp/package_ios_arm64/lib/libgmp.a ../package_ios/lib
cp \
./src/Release-iphoneos/libfr.a \
./src/Release-iphoneos/libwitnesscalc_authV2.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQueryMTPV2.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQueryMTPV2OnChain.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQuerySigV2.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQuerySigV2OnChain.a \
../package_ios/lib
cp -r ../package/include ../package_ios/include
cd ../
mkdir build_prover_ios_simulator && cd build_prover_ios_simulator
cmake .. -GXcode -DTARGET_PLATFORM=IOS -DCMAKE_INSTALL_PREFIX=../package_ios_simulator -DUSE_ASM=NO
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_authV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQueryMTPV2OnChainStatic
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQueryMTPV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQuerySigV2OnChainStatic
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQuerySigV2Static
mkdir -p ../package_ios_simulator/lib
cp ../depends/gmp/package_iphone_simulator/lib/libgmp.a src/Debug-iphonesimulator
cp \
./src/Debug-iphonesimulator/libfr.a \
./src/Debug-iphonesimulator/libwitnesscalc_authV2.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQueryMTPV2.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQueryMTPV2OnChain.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQuerySigV2.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQuerySigV2OnChain.a \
../package_ios_simulator/lib
cp -r ../package/include ../package_ios_simulator/include
cd ../
mkdir build_prover_macos_arm64 && cd build_prover_macos_arm64
cmake .. -DTARGET_PLATFORM=macos_arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package_macos_arm64
make -j4 && make install
- name: upload macOS arm64 artifacts
uses: actions/upload-artifact@v3
with:
name: witnesscalc-macOS-arm64
path: |
package
if-no-files-found: error
- name: upload iOS artifacts
uses: actions/upload-artifact@v3
with:
name: witnesscalc-iOS
path: |
package_ios
if-no-files-found: error
- name: upload iOS Simulator artifacts
uses: actions/upload-artifact@v3
with:
name: witnesscalc-iOS-Simulator
path: |
package_ios_simulator
if-no-files-found: error