Change paths #62
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 | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build_native: | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| matrix: | |
| config: | |
| - { os: windows-latest, runtime: win-x64 } | |
| - { os: ubuntu-latest, runtime: linux-x64 } | |
| - { os: macos-latest, runtime: osx-arm64 } | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Setup CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Download LLVM | |
| run: dotnet run --project ./AssetRipper.Bindings.LLVM.Downloader/AssetRipper.Bindings.LLVM.Downloader.csproj 21.1.8 ${{ matrix.config.runtime }} | |
| - name: List LLVM Directory | |
| run: ls -R ${{ github.workspace }}/AssetRipper.Bindings.LLVM.Downloader/bin/Debug/net10.0/llvm | |
| - name: Set up Clang | |
| if: matrix.config.runtime == 'linux-x64' || matrix.config.runtime == 'linux-arm64' || matrix.config.runtime == 'osx-arm64' | |
| uses: KyleMayes/install-llvm-action@v2 | |
| with: | |
| version: "21.1.8" | |
| - name: Set LLVM Path | |
| id: get-llvm-path | |
| shell: bash | |
| run: | | |
| echo "llvm_path=${GITHUB_WORKSPACE}/AssetRipper.Bindings.LLVM.Downloader/bin/Debug/net10.0/llvm" >> $GITHUB_OUTPUT | |
| - name: Build Native Library (Windows) | |
| if: matrix.config.runtime == 'win-x64' || matrix.config.runtime == 'win-arm64' | |
| run: | | |
| cmake -S ./Native -B ./Native/build -DLLVM_ROOT="${{ steps.get-llvm-path.outputs.llvm_path }}" | |
| cmake --build ./Native/build --config Release | |
| - name: Build Native Library (Linux) | |
| if: matrix.config.runtime == 'linux-x64' || matrix.config.runtime == 'linux-arm64' | |
| run: | | |
| cmake -S ./Native -B ./Native/build -DLLVM_ROOT="${{ steps.get-llvm-path.outputs.llvm_path }}" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ./Native/build --config Release | |
| - name: Build Native Library (MacOS) | |
| if: matrix.config.runtime == 'osx-arm64' | |
| run: | | |
| cmake -S ./Native -B ./Native/build -DLLVM_ROOT="${{ steps.get-llvm-path.outputs.llvm_path }}" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ./Native/build --config Release | |
| - name: List Native Directory | |
| run: ls -R ${{ github.workspace }}/Native | |
| - name: Upload Artifacts (Windows) | |
| if: matrix.config.runtime == 'win-x64' || matrix.config.runtime == 'win-arm64' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: libLLVM_${{ matrix.config.runtime }} | |
| path: ./Native/build/Release/libLLVM.dll | |
| if-no-files-found: error | |
| - name: Upload Artifacts (MacOS) | |
| if: matrix.config.runtime == 'osx-arm64' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: libLLVM_${{ matrix.config.runtime }} | |
| path: ./Native/build/libLLVM.dylib | |
| if-no-files-found: error | |
| - name: Upload Artifacts (Linux) | |
| if: matrix.config.runtime == 'linux-x64' || matrix.config.runtime == 'linux-arm64' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: libLLVM_${{ matrix.config.runtime }} | |
| path: ./Native/build/libLLVM.so | |
| if-no-files-found: error | |
| build_managed: | |
| runs-on: ubuntu-latest | |
| needs: build_native | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore Dependencies | |
| run: dotnet restore | |
| - name: Download Native Artifacts (linux-x64) | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: libLLVM_linux-x64 | |
| path: ./Packages/AssetRipper.Bindings.LLVM.Linux.X64 | |
| - name: Download Native Artifacts (osx-arm64) | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: libLLVM_osx-arm64 | |
| path: ./Packages/AssetRipper.Bindings.LLVM.Mac.Arm64 | |
| - name: Download Native Artifacts (win-x64) | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: libLLVM_win-x64 | |
| path: ./Packages/AssetRipper.Bindings.LLVM.Windows.X64 | |
| - name: List Packages Directory | |
| run: ls -R ${{ github.workspace }}/Packages | |
| - name: Build Managed Library | |
| run: dotnet build --configuration Release |