From c11f3095a56ddcb04581e365e9c072af34a1941f Mon Sep 17 00:00:00 2001 From: SashaXser <24498484+SashaXser@users.noreply.github.com> Date: Wed, 14 Aug 2024 01:00:07 +0400 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 51 +++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 277d6325..92ee011a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ env: WINDIVERT_NAME: WinDivert-2.2.2-A.zip WINDIVERT_BASENAME: WinDivert-2.2.2-A WINDIVERT_SHA256: 63cb41763bb4b20f600b6de04e991a9c2be73279e317d4d82f237b150c5f3f15 + LLVM_MINGW_VERSION: 20240805 jobs: build: @@ -23,33 +24,39 @@ jobs: run: | echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: Install MinGW-w64 - run: > - sudo rm /var/lib/man-db/auto-update && - sudo DEBIAN_FRONTEND=noninteractive XZ_DEFAULTS="-T0" XZ_OPT="-T0" eatmydata - apt install -y --no-install-recommends gcc-mingw-w64 + - name: Install dependencies + run: | + sudo apt update && + sudo apt install -y wget unzip + + - name: Download and install LLVM-Mingw + run: | + LLVM_MINGW_URL="https://github.com/mstorsjo/llvm-mingw/releases/download/${{ env.LLVM_MINGW_VERSION }}/llvm-mingw-${{ env.LLVM_MINGW_VERSION }}-ucrt-ubuntu-20.04-x86_64.tar.xz" && + wget $LLVM_MINGW_URL && + tar -xf llvm-mingw-${{ env.LLVM_MINGW_VERSION }}-ucrt-ubuntu-20.04-x86_64.tar.xz && + sudo cp -r llvm-mingw-${{ env.LLVM_MINGW_VERSION }}-ucrt-ubuntu-20.04-x86_64/* /usr/local/ - name: Download WinDivert from cache id: windivert-cache uses: actions/cache@v4 with: - path: ${{ env. WINDIVERT_NAME }} - key: ${{ env. WINDIVERT_SHA256 }} + path: ${{ env.WINDIVERT_NAME }} + key: ${{ env.WINDIVERT_SHA256 }} - name: Download WinDivert from the website if: steps.windivert-cache.outputs.cache-hit != 'true' - run: > - wget ${{ env. WINDIVERT_URL }} && - (echo ${{ env. WINDIVERT_SHA256 }} ${{ env. WINDIVERT_NAME }} | sha256sum -c) + run: | + wget ${{ env.WINDIVERT_URL }} && + (echo ${{ env.WINDIVERT_SHA256 }} ${{ env.WINDIVERT_NAME }} | sha256sum -c) - name: Unpack WinDivert - run: unzip ${{ env. WINDIVERT_NAME }} + run: unzip ${{ env.WINDIVERT_NAME }} - name: Compile x86_64 - run: > + run: | cd src && make clean && - make CPREFIX=x86_64-w64-mingw32- BIT64=1 WINDIVERTHEADERS=../${{ env.WINDIVERT_BASENAME }}/include WINDIVERTLIBS=../${{ env.WINDIVERT_BASENAME }}/x64 -j4 - + make CC=x86_64-w64-mingw32-clang CPREFIX=x86_64-w64-mingw32- BIT64=1 WINDIVERTHEADERS=../${{ env.WINDIVERT_BASENAME }}/include WINDIVERTLIBS=../${{ env.WINDIVERT_BASENAME }}/x64 -j4 + - name: Prepare x86_64 directory run: | mkdir goodbyedpi_x86_64_${{ steps.vars.outputs.sha_short }} @@ -60,19 +67,3 @@ jobs: with: name: goodbyedpi_x86_64_${{ steps.vars.outputs.sha_short }} path: goodbyedpi_x86_64_${{ steps.vars.outputs.sha_short }} - - # - name: Compile i686 - # run: > - # cd src && make clean && - # make CPREFIX=i686-w64-mingw32- WINDIVERTHEADERS=../${{ env.WINDIVERT_BASENAME }}/include WINDIVERTLIBS=../${{ env.WINDIVERT_BASENAME }}/x86 -j4 - - # - name: Prepare x86 directory - # run: | - # mkdir goodbyedpi_x86_${{ steps.vars.outputs.sha_short }} - # cp src/goodbyedpi.exe ${{ env.WINDIVERT_BASENAME }}/x86/*.{dll,sys} goodbyedpi_x86_${{ steps.vars.outputs.sha_short }} - - # - name: Upload output file x86 - # uses: actions/upload-artifact@v3 - # with: - # name: goodbyedpi_x86_${{ steps.vars.outputs.sha_short }} - # path: goodbyedpi_x86_${{ steps.vars.outputs.sha_short }}