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