Skip to content

Fix Wireshark version util #235

Fix Wireshark version util

Fix Wireshark version util #235

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip build]')"
env:
PLATFORM: x64
WIRESHARK_DIR: ${{ github.workspace }}/wireshark
WIRESHARK_LIB_DIR: C:/wireshark-win64-libs-4.2
WIRESHARK_BUILD_DIR: ${{ github.workspace }}/wireshark/build
WIRESHARK_LIB_FILE_DIR: ${{ github.workspace }}/wireshark/build/run/RelWithDebInfo
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
path: dissector
- name: Checkout Wireshark
uses: actions/checkout@v4
with:
repository: wireshark/wireshark
path: wireshark
ref: wireshark-4.2.5
- name: Choco install Wireshark Deps
run: choco install -y --no-progress cmake winflexbison3 strawberryperl asciidoctorj xsltproc docbook-bundle ninja make mingw
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-version: 16.4
- name: Make build dir
run: mkdir build
working-directory: wireshark
- name: Configure Wireshark
run: cmake -A x64 .. -DBUILD_wireshark=OFF
working-directory: wireshark/build
- run: cmake --build . --config RelWithDebInfo --target epan
working-directory: wireshark/build
- name: Configure dissector (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -G Ninja -B build
working-directory: dissector
- name: Configure dissector (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -G Ninja -B build
working-directory: dissector
- name: Build dissector
run: cmake --build build --target MC_Dissector
working-directory: dissector
- name: Configure dissector - No Function Feature (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -G Ninja -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
working-directory: dissector
- name: Configure dissector - No Function Feature (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -G Ninja -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
working-directory: dissector
- name: Build dissector - No Function Feature
run: cmake --build build-no-function --target MC_Dissector
working-directory: dissector
- name: Upload dissector
uses: actions/upload-artifact@v3
with:
name: windows
path: dissector/build/mcdissector.dll
- name: Upload dissector (no function)
uses: actions/upload-artifact@v3
with:
name: windows-no-function
path: dissector/build-no-function/mcdissector.dll
build-linux:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip build]')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install Deps
run: |
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt-get update & sudo apt-get install cmake libwireshark-dev make clang
- name: Configure dissector (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -B build
- name: Configure dissector (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
- name: Build dissector
run: make -j8
working-directory: build
- name: Configure dissector - No Function (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
run: cmake -S . -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
- name: Configure dissector - No Function (Release)
if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta')"
run: cmake -DCMAKE_BUILD_TYPE=Release -S . -B build-no-function -DMC_DISSECTOR_FUNCTION_FEATURE=OFF
- name: Build dissector - No Function
run: make -j8
working-directory: build-no-function
- name: Upload dissector
uses: actions/upload-artifact@v3
with:
name: linux
path: build/mcdissector.so
- name: Upload dissector (no function)
uses: actions/upload-artifact@v3
with:
name: linux-no-function
path: build-no-function/mcdissector.so
build-encryption-helper:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip build]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
- name: Chmod Gradlew
run: chmod +x gradlew
working-directory: encryption-helper
- name: Build Encryption Helper
run: ./gradlew shadowJar
working-directory: encryption-helper
- name: Upload Encryption Helper
uses: actions/upload-artifact@v3
with:
name: encryption-helper
path: encryption-helper/build/libs/encryption-helper-1.0-all.jar
publish:
needs: [ build-windows, build-linux, build-encryption-helper ]
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
permissions: write-all
steps:
- name: Download windows artifact
uses: actions/download-artifact@v3
with:
name: windows
path: windows
- name: Download windows artifact (no function)
uses: actions/download-artifact@v3
with:
name: windows-no-function
path: windows-no-function
- name: Download linux artifact
uses: actions/download-artifact@v3
with:
name: linux
path: linux
- name: Download linux artifact (no function)
uses: actions/download-artifact@v3
with:
name: linux-no-function
path: linux-no-function
- name: Download encryption-helper artifact
uses: actions/download-artifact@v3
with:
name: encryption-helper
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ contains(github.ref, 'beta') }}
- name: Upload mcdissector.dll
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows/mcdissector.dll
asset_name: mcdissector.dll
asset_content_type: application/octet-stream
- name: Upload mcdissector-no-function.dll
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-no-function/mcdissector.dll
asset_name: mcdissector-no-function.dll
asset_content_type: application/octet-stream
- name: Upload mcdissector.so
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux/mcdissector.so
asset_name: mcdissector.so
asset_content_type: application/octet-stream
- name: Upload mcdissector-no-function.so
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux-no-function/mcdissector.so
asset_name: mcdissector-no-function.so
asset_content_type: application/octet-stream
- name: Upload encryption-helper
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./encryption-helper-1.0-all.jar
asset_name: encryption-helper.jar
asset_content_type: application/octet-stream