-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kptools: Support compile kptools for windows target (#37)
* kptools: Support compile for windows target * ci: Support build for windows mingw32
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,6 +215,52 @@ jobs: | |
allowUpdates: true | ||
replacesArtifacts: true | ||
|
||
Build-kptools-windows: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
- name: Install mingw32 cross toolchains | ||
run: | | ||
MINGW_LLVM_URL="https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-msvcrt-ubuntu-20.04-x86_64.tar.xz" | ||
mkdir -p $HOME/mingw-llvm | ||
wget $MINGW_LLVM_URL -O $HOME/mingw-llvm/llvm.tar.xz | ||
cd $HOME/mingw-llvm | ||
tar -xvf llvm.tar.xz --strip-components 1 | ||
- name: Generate version | ||
id: parse_version | ||
run: | | ||
MAJOR=$(grep '#define MAJOR' version | awk '{print $3}') | ||
MINOR=$(grep '#define MINOR' version | awk '{print $3}') | ||
PATCH=$(grep '#define PATCH' version | awk '{print $3}') | ||
VERSION="$MAJOR.$MINOR.$PATCH" | ||
echo "Generated Version: $VERSION" | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Build kptools | ||
run: | | ||
export PATH="$HOME/mingw-llvm/bin:$PATH" | ||
export ANDROID=1 | ||
ABIS="x86_64 i686 aarch64 armv7" | ||
for i in $ABIS; do | ||
make -C kernel hdr TARGET_COMPILE=placeholder | ||
echo "- Compiling kptools-$i-win.exe" | ||
make -C tools CC=$i-w64-mingw32-clang | ||
mv tools/kptools.exe kptools-$i-win.exe | ||
make -C tools clean | ||
done | ||
7za a kptools-win.zip -tZIP *.exe | ||
- name: Release | ||
uses: ncipollo/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.parse_version.outputs.VERSION }} | ||
artifacts: | | ||
kptools-win.zip | ||
allowUpdates: true | ||
replacesArtifacts: true | ||
|
||
Build-kptools-mac: | ||
runs-on: macos-latest | ||
permissions: | ||
|
This file contains 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