forked from facebook/yoga
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (107 loc) · 3.55 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
name: Build Binaries
on:
- push
- pull_request
- workflow_dispatch
defaults:
run:
shell: bash
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup-cpp
with:
toolchain: Clang
- name: Setup JS
uses: ./.github/actions/setup-js
- name: Restore emsdk
uses: ./.github/actions/cache-emsdk
- name: Build
run: |
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja
cmake --build build --config Release
mkdir -p dist/linux
cp build/libyogacore.so dist/linux/libyoga.so
- name: Build JS
working-directory: javascript
run: |
yarn build
mkdir -p ../dist/webgl
cp build/libyogaObjLib.a ../dist/webgl/libyoga.a
- name: Upload Binaries
uses: actions/upload-artifact@v3
if: github.event_name == 'push'
with:
path: dist/**
name: prebuilt_yoga_binaries
build-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup-cpp
with:
toolchain: CLang
- name: Setup Apple
uses: ./.github/actions/setup-apple
- name: Build
run: |
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON
cmake --build build --config Release
mkdir -p dist/osx
cp build/libyogacore.dylib dist/osx/libyoga.dylib
- name: Build IOS
run: |
rm -rf build
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_Swift_COMPILER_FORCED=true -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
cmake --build build --config Release
mkdir -p dist/iOS
cp -a build/ dist/iOS/
- name: Upload Binaries
uses: actions/upload-artifact@v3
if: github.event_name == 'push'
with:
path: dist/**
name: prebuilt_yoga_binaries
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup-cpp
with:
toolchain: MSVC
- name: Build
run: |
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON
cmake -B build32 -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -A Win32
cmake --build build --config Release
cmake --build build32 --config Release
mkdir -p dist/win-x64 dist/win-x86
cp build/Release/yogacore.dll dist/win-x64/yoga.dll
cp build32/Release/yogacore.dll dist/win-x86/yoga.dll
- name: Upload Binaries
uses: actions/upload-artifact@v3
if: github.event_name == 'push'
with:
path: dist/**
name: prebuilt_yoga_binaries
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-android
- name: Build
run: |
./gradlew :yoga:assembleRelease
mkdir -p dist/android
cp java/build/outputs/aar/yoga-release.aar dist/android/yoga.aar
- name: Upload Binaries
uses: actions/upload-artifact@v3
if: github.event_name == 'push'
with:
path: dist/**
name: prebuilt_yoga_binaries