diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index e2a4dbd41..246921ff5 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -235,3 +235,25 @@ jobs: export PATH="/c/msys64/mingw64/bin:$PATH" export PKG_CONFIG_PATH=$(pwd)/pkg-config ./make.bat lint + + validate-rules: + runs-on: windows-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download MSI + uses: actions/download-artifact@v4 + with: + name: "fibratus-amd64.msi" + path: . + - name: Install MSI + shell: bash + run: | + ./make.bat install + - name: Validate + shell: bash + run: | + export PATH="/c/Program Files/Fibratus/Bin:$PATH" + fibratus rules list + fibratus rules validate diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0f52990ea..76b61f778 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -217,3 +217,25 @@ jobs: export PATH="/c/msys64/mingw64/bin:$PATH" export PKG_CONFIG_PATH=$(pwd)/pkg-config ./make.bat lint + + validate-rules: + runs-on: windows-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download MSI + uses: actions/download-artifact@v4 + with: + name: "fibratus-amd64.msi" + path: . + - name: Install MSI + shell: bash + run: | + ./make.bat install + - name: Validate + shell: bash + run: | + export PATH="/c/Program Files/Fibratus/Bin:$PATH" + fibratus rules list + fibratus rules validate diff --git a/.github/workflows/rules.yml b/.github/workflows/rules.yml deleted file mode 100644 index ffeb94afa..000000000 --- a/.github/workflows/rules.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: rules - -on: - workflow_run: - workflows: ["master", "pr"] - types: - - completed - -jobs: - validate: - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Download MSI - uses: dawidd6/action-download-artifact@v6 - with: - run_id: ${{ github.event.workflow_run.id }} - name: fibratus-amd64.msi - path: . - search_artifacts: true - - name: Install Fibratus - shell: bash - run: | - ./make.bat install - - name: Validate rules - shell: bash - run: | - export PATH="/c/Program Files/Fibratus/Bin:$PATH" - fibratus rules list - fibratus rules validate diff --git a/make.bat b/make.bat index 6f2dd7653..c6dd53632 100644 --- a/make.bat +++ b/make.bat @@ -14,6 +14,8 @@ SetLocal EnableDelayedExpansion set PYTHON_VER=3.7.9 set PYTHON_URL=https://www.python.org/ftp/python/%PYTHON_VER%/python-%PYTHON_VER%-embed-amd64.zip +set WIX_VERSION=5.0.0 + set GOBIN=%USERPROFILE%\go\bin set GOTEST=go test -timeout=10m -v -gcflags=all=-d=checkptr=0 @@ -118,7 +120,7 @@ robocopy ".\rules" "%RELEASE_DIR%\Rules" /E /S /XF *.md *.png :: Download the embedded Python distribution echo Downloading Python %PYTHON_VER%... -powershell -Command "Invoke-WebRequest %PYTHON_URL% -OutFile %RELEASE_DIR%\python.zip" +powershell -Command "Invoke-WebRequest %PYTHON_URL% -OutFile %RELEASE_DIR%\python.zip" || goto :fail echo Extracting Python distribution... powershell -Command "Expand-Archive %RELEASE_DIR%\python.zip -DestinationPath %RELEASE_DIR%\python" @@ -146,9 +148,9 @@ copy %SystemRoot%\System32\dbghelp.dll "%RELEASE_DIR%\Bin" echo Building MSI package... pushd . cd build/msi -wix extension add WixToolset.UI.wixext || exit /b -wix extension add WixToolset.Util.wixext || exit /b -wix build -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -b dir=fibratus-%VERSION% fibratus.wxs -arch x64 -d VERSION=%VERSION% -o fibratus-%VERSION%-amd64.msi || exit /b +wix extension add WixToolset.UI.wixext/%WIX_VERSION% || goto :fail +wix extension add WixToolset.Util.wixext/%WIX_VERSION% || goto :fail +wix build -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -b dir=fibratus-%VERSION% fibratus.wxs -arch x64 -d VERSION=%VERSION% -o fibratus-%VERSION%-amd64.msi || goto :fail popd echo fibratus-%VERSION%-amd64.msi MSI package built successfully @@ -180,14 +182,12 @@ copy %SystemRoot%\System32\dbghelp.dll "%RELEASE_DIR%\Bin" echo Building MSI package... pushd . cd build/msi -wix extension add WixToolset.UI.wixext || exit /b -wix extension add WixToolset.Util.wixext || exit /b -wix build -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -b dir=fibratus-%VERSION%-slim fibratus.wxs -arch x64 -d VERSION=%VERSION% -o fibratus-%VERSION%-slim-amd64.msi || exit /b +wix extension add WixToolset.UI.wixext/%WIX_VERSION% || goto :fail +wix extension add WixToolset.Util.wixext/%WIX_VERSION% || goto :fail +wix build -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -b dir=fibratus-%VERSION%-slim fibratus.wxs -arch x64 -d VERSION=%VERSION% -o fibratus-%VERSION%-slim-amd64.msi || goto :fail popd echo fibratus-%VERSION%-slim-amd64.msi MSI package built successfully -if errorlevel 1 goto fail - goto :EOF :clean