Skip to content

Commit d0a7138

Browse files
committed
separate build steps
1 parent b1fb78c commit d0a7138

File tree

1 file changed

+55
-36
lines changed

1 file changed

+55
-36
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,81 @@ on:
55
- pull_request
66
- workflow_dispatch
77

8+
defaults:
9+
run:
10+
shell: bash
11+
812
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
1929
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
2039
steps:
2140
- uses: actions/checkout@v3
2241

2342
- name: Setup
2443
uses: ./.github/actions/setup-cpp
2544
with:
26-
toolchain: ${{ startsWith(matrix.os, 'windows') && 'MSVC' || 'Clang' }}
45+
toolchain: CLang
2746

2847
- name: Setup Apple
29-
if: startsWith(matrix.os, 'macos')
3048
uses: ./.github/actions/setup-apple
3149

32-
- name: Build (Windows)
33-
if: startsWith(matrix.os, 'windows')
50+
- name: Build
3451
run: |
3552
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
3753
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
3956
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
4663

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
5268

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
5873

59-
- name: Move Ubuntu files
60-
if: startsWith(matrix.os, 'ubuntu')
74+
- name: Build
6175
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
6483
6584
- name: Upload Binaries
6685
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)