Skip to content

Fix bugs

Fix bugs #268

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- 'README.MD'
- 'README-*.MD'
- 'LICENSE'
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.4
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.4.0
- 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/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Make build dir
run: mkdir build
working-directory: wireshark
- name: Configure Wireshark
run: cmake -A x64 .. -DBUILD_wireshark=OFF
working-directory: wireshark/build
- name: Build Wireshark
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: Upload dissector
uses: actions/upload-artifact@v4
with:
name: windows
path: dissector/build/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 libcjson-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: Upload dissector
uses: actions/upload-artifact@v4
with:
name: linux
path: build/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@v4
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@v4
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@v4
with:
name: windows
path: windows
- name: Download linux artifact
uses: actions/download-artifact@v4
with:
name: linux
path: linux
- name: Download encryption-helper artifact
uses: actions/download-artifact@v4
with:
name: encryption-helper
- id: process-name
env:
REF: ${{ github.ref }}
run: echo "NAME=${REF##*/}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.process-name.outputs.NAME }}
prerelease: ${{ contains(github.ref, 'beta') }}
files: |
windows/mcdissector.dll
linux/mcdissector.so
encryption-helper-1.0-all.jar