Update buildbinaryen.yml #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Binaryen | ||
|
Check failure on line 1 in .github/workflows/buildbinaryen.yml
|
||
| on: | ||
| workflow_dispatch: | ||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: windows-latest | ||
| arch: x64 | ||
| compiler-prefix: C:/tools/mingw64/bin/x86_64-w64-mingw32 | ||
| runtime: win-x64 | ||
| - os: windows-latest | ||
| arch: x86 | ||
| compiler-prefix: C:/tools/mingw32/bin/i686-w64-mingw32 | ||
| runtime: win-x86 | ||
| - os: ubuntu-latest | ||
| arch: x64 | ||
| runtime: linux-x64 | ||
| - os: ubuntu-latest | ||
| arch: x86 | ||
| runtime: linux-x86 | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| - name: Install build deps (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y g++-multilib gcc-multilib cmake make ninja-build | ||
| - name: Install build deps (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| choco install mingw --no-progress --yes | ||
| choco install cmake ninja --no-progress --yes | ||
| # Limit Binaryen to 1 core | ||
| - name: Limit Binaryen to 1 core | ||
| run: echo "BINARYEN_CORES=1" >> $GITHUB_ENV | ||
| - name: Configure | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| cmake -S binaryen -B binaryen/build \ | ||
| -DCMAKE_C_FLAGS="-m${{ matrix.arch == 'x64' && echo 64 || echo 32 }} -w -static-libgcc -static-libstdc++" \ | ||
| -DCMAKE_CXX_FLAGS="-m${{ matrix.arch == 'x64' && echo 64 || echo 32 }} -w -static-libgcc -static-libstdc++" \ | ||
| -DBUILD_SHARED_LIBS=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF | ||
| - name: Configure | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| $CC="${{ matrix.compiler-prefix }}-gcc.exe" | ||
| $CXX="${{ matrix.compiler-prefix }}-g++.exe" | ||
| cmake -S binaryen -B binaryen/build -G "MinGW Makefiles" ` | ||
| -DCMAKE_C_COMPILER=$CC ` | ||
| -DCMAKE_CXX_COMPILER=$CXX ` | ||
| -DCMAKE_C_FLAGS="-W0 -m${{ matrix.arch == 'x64' && echo 64 || echo 32 }} -static-libgcc -static-libstdc++" ` | ||
| -DCMAKE_CXX_FLAGS="-W0 -m${{ matrix.arch == 'x64' && echo 64 || echo 32 }} -static-libgcc -static-libstdc++" ` | ||
| -DBUILD_STATIC_LIB=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF | ||
| shell: pwsh | ||
| - name: Build (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: cmake --build binaryen/build -- -j1 | ||
| - name: Build (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: cmake --build binaryen/build -- -j1 | ||
| shell: pwsh | ||
| - name: Copy to NuGet runtime folder | ||
| run: | | ||
| mkdir -p package/runtimes/${{ matrix.runtime }}/native | ||
| cp -r binaryen/build/lib/* package/runtimes/${{ matrix.runtime }}/native/ | ||
| shell: bash | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: runtimes-${{ matrix.runtime }} | ||
| path: package/runtimes/${{ matrix.runtime }} | ||