diff --git a/.github/actions/install-wireshark-headers/action.yml b/.github/actions/install-wireshark-headers/action.yml new file mode 100644 index 0000000..6577304 --- /dev/null +++ b/.github/actions/install-wireshark-headers/action.yml @@ -0,0 +1,17 @@ +name: Install Wireshark headers +runs: + using: 'composite' + steps: + - name: Configure Wireshark + run: | + mkdir wireshark/build + cmake -B wireshark/build -S wireshark -DENABLE_CCACHE=Yes + shell: bash + - name: Install headers + run: sudo make -C wireshark/build install-headers + shell: bash + # Install headers is not available in older versions, use the full installation instead + - name: Install Wireshark + if: ${{ failure() && steps..outcome == 'failure' }} + run: sudo make -C wireshark/build -j$(nproc) install + shell: bash \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..51aa69c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release + +on: + workflow_dispatch: + inputs: + tag: + description: The tag to be released, e.g. v0.1.0 + required: true + pull_request: + +jobs: + release: + name: Release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + wireshark_version: [wireshark-4.2.5] + include: + # Ubuntu 22.04 Wireshark version + - os: ubuntu-latest + wireshark_version: wireshark-3.6.2 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Clone Wireshark + run: git clone --depth 1 --branch ${{ matrix.wireshark_version }} https://github.com/wireshark/wireshark + + - name: Install dependencies (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt update + sudo apt install -y ninja-build + sudo wireshark/tools/debian-setup.sh + + - name: Install Wireshark headers (Unix) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + uses: ./.github/actions/install-wireshark-headers + + - name: Build Traceeshark (Unix) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: | + make cmake + make + + - name: Create distribution archive (Unix) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: make dist