mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-08 00:43:06 +00:00
chore: CI for windows build (#3316)
This commit is contained in:
parent
dc571d0101
commit
926e69a12d
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -79,6 +79,11 @@ jobs:
|
|||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: make V=1 QUICK_AND_DIRTY_COMPILER=1 all tools
|
run: make V=1 QUICK_AND_DIRTY_COMPILER=1 all tools
|
||||||
|
|
||||||
|
trigger-windows-build:
|
||||||
|
uses: ./.github/workflows/windows-build.yml
|
||||||
|
with:
|
||||||
|
branch: ${{ github.ref }}
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
||||||
|
|||||||
120
.github/workflows/windows-build.yml
vendored
Normal file
120
.github/workflows/windows-build.yml
vendored
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
name: ci / build-windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
branch:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: msys2 {0}
|
||||||
|
|
||||||
|
env:
|
||||||
|
MSYSTEM: MINGW64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
update: true
|
||||||
|
install: >-
|
||||||
|
git
|
||||||
|
base-devel
|
||||||
|
mingw-w64-x86_64-toolchain
|
||||||
|
make
|
||||||
|
cmake
|
||||||
|
upx
|
||||||
|
mingw-w64-x86_64-rust
|
||||||
|
mingw-w64-x86_64-postgresql
|
||||||
|
mingw-w64-x86_64-gcc
|
||||||
|
mingw-w64-x86_64-gcc-libs
|
||||||
|
mingw-w64-x86_64-libwinpthread-git
|
||||||
|
mingw-w64-x86_64-zlib
|
||||||
|
mingw-w64-x86_64-openssl
|
||||||
|
mingw-w64-x86_64-python
|
||||||
|
mingw-w64-x86_64-cmake
|
||||||
|
mingw-w64-x86_64-llvm
|
||||||
|
mingw-w64-x86_64-clang
|
||||||
|
|
||||||
|
- name: Add UPX to PATH
|
||||||
|
run: |
|
||||||
|
echo "/usr/bin:$PATH" >> $GITHUB_PATH
|
||||||
|
echo "/mingw64/bin:$PATH" >> $GITHUB_PATH
|
||||||
|
echo "/usr/lib:$PATH" >> $GITHUB_PATH
|
||||||
|
echo "/mingw64/lib:$PATH" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Verify dependencies
|
||||||
|
run: |
|
||||||
|
which upx gcc g++ make cmake cargo rustc python
|
||||||
|
|
||||||
|
- name: Updating submodules
|
||||||
|
run: git submodule update --init --recursive
|
||||||
|
|
||||||
|
- name: Creating tmp directory
|
||||||
|
run: mkdir -p tmp
|
||||||
|
|
||||||
|
- name: Building Nim
|
||||||
|
run: |
|
||||||
|
cd vendor/nimbus-build-system/vendor/Nim
|
||||||
|
./build_all.bat
|
||||||
|
cd ../../../..
|
||||||
|
|
||||||
|
- name: Building libunwind
|
||||||
|
run: |
|
||||||
|
cd vendor/nim-libbacktrace
|
||||||
|
mkdir -p vendor/libunwind/build
|
||||||
|
pushd vendor/libunwind
|
||||||
|
|
||||||
|
cmake -S runtimes \
|
||||||
|
-DLLVM_ENABLE_RUNTIMES="libunwind" \
|
||||||
|
-DLIBUNWIND_ENABLE_SHARED=OFF -DLIBUNWIND_ENABLE_STATIC=ON \
|
||||||
|
-DLIBUNWIND_INCLUDE_DOCS=OFF -DLIBUNWIND_INSTALL_HEADERS=ON \
|
||||||
|
-DCMAKE_INSTALL_PREFIX="$(pwd)/../install/usr" \
|
||||||
|
-G "MinGW Makefiles" -B build
|
||||||
|
|
||||||
|
cd build
|
||||||
|
mingw32-make VERBOSE=1 clean
|
||||||
|
mingw32-make VERBOSE=1 unwind_static
|
||||||
|
mingw32-make VERBOSE=1 install-unwind
|
||||||
|
|
||||||
|
popd
|
||||||
|
mkdir -p install/usr/lib
|
||||||
|
cp -r vendor/libunwind/build/lib/libunwind.a install/usr/lib/
|
||||||
|
|
||||||
|
- name: Building miniupnpc
|
||||||
|
run: |
|
||||||
|
cd vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc
|
||||||
|
git checkout little_chore_windows_support
|
||||||
|
make -f Makefile.mingw CC=gcc CXX=g++ libminiupnpc.a V=1
|
||||||
|
cd ../../../../..
|
||||||
|
|
||||||
|
- name: Building libnatpmp
|
||||||
|
run: |
|
||||||
|
cd ./vendor/nim-nat-traversal/vendor/libnatpmp-upstream
|
||||||
|
make CC="gcc -fPIC -D_WIN32_WINNT=0x0600 -DNATPMP_STATICLIB" libnatpmp.a V=1
|
||||||
|
cd ../../../../
|
||||||
|
|
||||||
|
- name: Building wakunode2
|
||||||
|
run: |
|
||||||
|
cd vendor/nim-libbacktrace
|
||||||
|
cp ./vendor/libunwind/build/lib/libunwind.a install/usr/lib
|
||||||
|
cd ../..
|
||||||
|
make wakunode2 LOG_LEVEL=DEBUG V=3 -j8
|
||||||
|
|
||||||
|
- name: Check Executable
|
||||||
|
run: |
|
||||||
|
if [ -f "./build/wakunode2.exe" ]; then
|
||||||
|
echo "wakunode2.exe build successful"
|
||||||
|
else
|
||||||
|
echo "Build failed: wakunode2.exe not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user