CI: Try fix shellcode build issue in macos #16
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 patcher for multi platforms. | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Windows x86_64 | |
| - os: windows-latest | |
| arch: x86_64 | |
| c_compiler: cl | |
| cpp_compiler: cl | |
| # Windows ARM64 | |
| - os: windows-11-arm | |
| arch: aarch64 | |
| c_compiler: cl | |
| cpp_compiler: cl | |
| # Linux x86_64 | |
| - os: ubuntu-latest | |
| arch: x86_64 | |
| c_compiler: clang | |
| cpp_compiler: clang | |
| # Linux ARM64 | |
| - os: ubuntu-24.04-arm | |
| arch: aarch64 | |
| c_compiler: clang | |
| cpp_compiler: clang | |
| # macOS x86_64 | |
| - os: macos-latest | |
| arch: x86_64 | |
| c_compiler: clang | |
| cpp_compiler: clang | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set reusable strings | |
| id: strings | |
| shell: bash | |
| run: | | |
| echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
| - name: Install dependencies (macOS) | |
| if: ${{ matrix.os == 'macos-latest' }} | |
| run: | | |
| brew install binutils | |
| echo 'export PATH="/opt/homebrew/opt/binutils/bin:$PATH"' >> /Users/runner/.bash_profile | |
| - name: Configure Compiler | |
| if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' }} | |
| run: | | |
| sudo apt install gcc-aarch64-linux-gnu | |
| echo -e \\nset\(CMAKE_C_FLAGS "--target=${{ matrix.arch }}-linux-gnu"\) \\n >> ${{ github.workspace }}/CMakeLists.txt | |
| - name: Configure CMake | |
| run: > | |
| cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
| -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
| -DCMAKE_BUILD_TYPE=Release | |
| -S ${{ github.workspace }} | |
| - name: Build Patcher and other tools | |
| run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DualBootKernelPatcher-${{ matrix.os }}-${{ matrix.arch }} | |
| path: | | |
| ${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelPatcher* | |
| ${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelRemover* | |
| ${{ steps.strings.outputs.build-output-dir }}/**/HDRTool* |