Skip to content

Commit c2af951

Browse files
CI: Fix cross compile issue.
1 parent 3201435 commit c2af951

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ${{ matrix.os }}
14-
1514
strategy:
1615
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
1716
fail-fast: false
@@ -23,7 +22,7 @@ jobs:
2322
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
2423
matrix:
2524
os: [ubuntu-latest, windows-latest, macos-latest]
26-
arch: [x64, arm64]
25+
arch: [x86_64, aarch64]
2726
build_type: [Release]
2827
c_compiler: [clang, cl]
2928
include:
@@ -35,10 +34,14 @@ jobs:
3534
exclude:
3635
- os: windows-latest
3736
c_compiler: clang
37+
- os: windows-latest
38+
arch: aarch64
3839
- os: ubuntu-latest
3940
c_compiler: cl
4041
- os: macos-latest
4142
c_compiler: cl
43+
- os: macos-latest
44+
arch: aarch64
4245

4346
steps:
4447
- uses: actions/checkout@v4
@@ -49,7 +52,13 @@ jobs:
4952
run: |
5053
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
5154
echo >> $GITHUB_ENV
52-
55+
56+
- name: Configure Compiler
57+
if: ${{ matrix.os == 'ubuntu-latest' }}
58+
run: |
59+
sudo apt install gcc-aarch64-linux-gnu
60+
echo -e \\nset\(CMAKE_C_FLAGS "--target=${{ matrix.arch }}-linux-gnu"\) \\n >> ${{ github.workspace }}/CMakeLists.txt
61+
5362
- name: Configure CMake
5463
run: >
5564
cmake -B ${{ steps.strings.outputs.build-output-dir }}
@@ -63,55 +72,49 @@ jobs:
6372

6473
- name: Upload Windows x64 Artifact
6574
uses: actions/upload-artifact@v4
66-
if: ${{ matrix.arch == 'x64' && matrix.os == 'windows-latest' }}
75+
if: ${{ matrix.arch == 'x86_64' && matrix.os == 'windows-latest' }}
6776
with:
6877
name: DualBootKernelPatcher-Windows-x64
69-
path: ${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher*
78+
path: |
79+
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelPatcher.exe
80+
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelRemover.exe
7081
7182
- name: Upload Linux x64 Artifact
7283
uses: actions/upload-artifact@v4
73-
if: ${{ matrix.arch == 'x64' && matrix.os == 'ubuntu-latest' }}
84+
if: ${{ matrix.arch == 'x86_64' && matrix.os == 'ubuntu-latest' }}
7485
with:
7586
name: DualBootKernelPatcher-Linux-x64
76-
path: ${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher*
77-
87+
path: |
88+
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher
89+
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelRemover
90+
7891
- name: Upload MacOS x64 Artifact
7992
uses: actions/upload-artifact@v4
80-
if: ${{ matrix.arch == 'x64' && matrix.os == 'macos-latest' }}
93+
if: ${{ matrix.arch == 'x86_64' && matrix.os == 'macos-latest' }}
8194
with:
8295
name: DualBootKernelPatcher-MacOS-x64
83-
path: ${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher*
84-
85-
- name: Upload Windows arm64 Artifact
86-
uses: actions/upload-artifact@v4
87-
if: ${{ matrix.arch == 'arm64' && matrix.os == 'windows-latest' }}
88-
with:
89-
name: DualBootKernelPatcher-Windows-arm64
90-
path: ${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher*
96+
path: |
97+
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher
98+
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelRemover
9199
92100
- name: Upload Linux arm64 Artifact
93101
uses: actions/upload-artifact@v4
94-
if: ${{ matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest' }}
102+
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'ubuntu-latest' }}
95103
with:
96104
name: DualBootKernelPatcher-Linux-arm64
97-
path: ${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher*
98-
99-
- name: Upload MacOS arm64 Artifact
100-
uses: actions/upload-artifact@v4
101-
if: ${{ matrix.arch == 'arm64' && matrix.os == 'macos-latest' }}
102-
with:
103-
name: DualBootKernelPatcher-MacOS-arm64
104-
path: ${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher*
105+
path: |
106+
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher
107+
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelRemover
105108
106109
- name: Build shellcodes.
107-
if: ${{ matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest' }}
110+
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'ubuntu-latest' }}
108111
run: |
109112
sudo apt install binutils-aarch64-linux-gnu
110113
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target all
111114
112115
- name: Upload ShellCode Artifact
113116
uses: actions/upload-artifact@v4
114-
if: ${{ matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest' }}
117+
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'ubuntu-latest' }}
115118
with:
116119
name: Shellcodes
117-
path: ${{ steps.strings.outputs.build-output-dir }}/ShellCode/*.bin
120+
path: ${{ steps.strings.outputs.build-output-dir }}/ShellCode/*.bin

0 commit comments

Comments
 (0)