|
5 | 5 | - pull_request |
6 | 6 | - workflow_dispatch |
7 | 7 |
|
| 8 | +defaults: |
| 9 | + run: |
| 10 | + shell: bash |
| 11 | + |
8 | 12 | jobs: |
9 | | - build: |
10 | | - name: Build ${{ matrix.os }} |
11 | | - runs-on: ${{ matrix.os }} |
12 | | - defaults: |
13 | | - run: |
14 | | - shell: bash |
15 | | - strategy: |
16 | | - fail-fast: false |
17 | | - matrix: |
18 | | - os: [macos-13, ubuntu-latest, windows-latest] |
| 13 | + build-linux: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + |
| 18 | + - name: Setup |
| 19 | + uses: ./.github/actions/setup-cpp |
| 20 | + with: |
| 21 | + toolchain: Clang |
| 22 | + |
| 23 | + - name: Build |
| 24 | + run: | |
| 25 | + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja |
| 26 | + cmake --build build --config Release |
| 27 | + mkdir -p dist/linux |
| 28 | + cp build/libyogacore.so dist/linux/libyoga.so |
19 | 29 |
|
| 30 | + - name: Upload Binaries |
| 31 | + uses: actions/upload-artifact@v3 |
| 32 | + if: github.event_name == 'push' |
| 33 | + with: |
| 34 | + path: dist/** |
| 35 | + name: prebuilt_yoga_binaries |
| 36 | + |
| 37 | + build-macos: |
| 38 | + runs-on: macos-13 |
20 | 39 | steps: |
21 | 40 | - uses: actions/checkout@v3 |
22 | 41 |
|
23 | 42 | - name: Setup |
24 | 43 | uses: ./.github/actions/setup-cpp |
25 | 44 | with: |
26 | | - toolchain: ${{ startsWith(matrix.os, 'windows') && 'MSVC' || 'Clang' }} |
| 45 | + toolchain: CLang |
27 | 46 |
|
28 | 47 | - name: Setup Apple |
29 | | - if: startsWith(matrix.os, 'macos') |
30 | 48 | uses: ./.github/actions/setup-apple |
31 | 49 |
|
32 | | - - name: Build (Windows) |
33 | | - if: startsWith(matrix.os, 'windows') |
| 50 | + - name: Build |
34 | 51 | run: | |
35 | 52 | cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON |
36 | | - cmake -B build32 -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -A Win32 |
37 | 53 | cmake --build build --config Release |
38 | | - cmake --build build32 --config Release |
| 54 | + mkdir -p dist/osx |
| 55 | + cp build/libyogacore.dylib dist/osx/libyoga.dylib |
39 | 56 |
|
40 | | - - name: Move Windows files |
41 | | - if: startsWith(matrix.os, 'windows') |
42 | | - run: | |
43 | | - mkdir -p dist/win-x64 dist/win-x86 |
44 | | - cp build/Release/yogacore.dll dist/win-x64/yoga.dll |
45 | | - cp build32/Release/yogacore.dll dist/win-x86/yoga.dll |
| 57 | + - name: Upload Binaries |
| 58 | + uses: actions/upload-artifact@v3 |
| 59 | + if: github.event_name == 'push' |
| 60 | + with: |
| 61 | + path: dist/** |
| 62 | + name: prebuilt_yoga_binaries |
46 | 63 |
|
47 | | - - name: Build (non-Windows) |
48 | | - if: startsWith(matrix.os, 'windows') != true |
49 | | - run: | |
50 | | - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja |
51 | | - cmake --build build --config Release |
| 64 | + build-windows: |
| 65 | + runs-on: windows-latest |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v3 |
52 | 68 |
|
53 | | - - name: Move MacOS files |
54 | | - if: startsWith(matrix.os, 'macos') |
55 | | - run: | |
56 | | - mkdir -p dist/osx |
57 | | - cp build/libyogacore.dylib dist/osx/libyoga.dylib |
| 69 | + - name: Setup |
| 70 | + uses: ./.github/actions/setup-cpp |
| 71 | + with: |
| 72 | + toolchain: MSVC |
58 | 73 |
|
59 | | - - name: Move Ubuntu files |
60 | | - if: startsWith(matrix.os, 'ubuntu') |
| 74 | + - name: Build |
61 | 75 | run: | |
62 | | - mkdir -p dist/linux |
63 | | - cp build/libyogacore.so dist/linux/libyoga.so |
| 76 | + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON |
| 77 | + cmake -B build32 -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -A Win32 |
| 78 | + cmake --build build --config Release |
| 79 | + cmake --build build32 --config Release |
| 80 | + mkdir -p dist/win-x64 dist/win-x86 |
| 81 | + cp build/Release/yogacore.dll dist/win-x64/yoga.dll |
| 82 | + cp build32/Release/yogacore.dll dist/win-x86/yoga.dll |
64 | 83 |
|
65 | 84 | - name: Upload Binaries |
66 | 85 | uses: actions/upload-artifact@v3 |
|
0 commit comments