Nightly Build #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly Build | |
| on: | |
| schedule: | |
| - cron: '0 4 * * *' # 04:00 UTC daily | |
| workflow_dispatch: # manual trigger | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ── x86_64 build (CLI + GUI) ─────────────────────────────────────────────── | |
| build-x86_64: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| build-essential cmake pkg-config \ | |
| libhackrf-dev libpulse-dev libusb-1.0-0-dev \ | |
| libsdl2-dev libimgui-dev libgl-dev | |
| - name: Fetch imgui backends | |
| run: | | |
| # Ubuntu 24.04's libimgui-dev doesn't ship backend .cpp files; | |
| # grab them from the matching upstream release. | |
| IMGUI_VER=$(pkg-config --modversion imgui) | |
| echo "System imgui version: $IMGUI_VER" | |
| git clone --depth=1 --branch "v${IMGUI_VER}" \ | |
| https://github.com/ocornut/imgui.git /tmp/imgui || \ | |
| git clone --depth=1 https://github.com/ocornut/imgui.git /tmp/imgui | |
| - name: Build | |
| run: | | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ | |
| -DIMGUI_BACKENDS_DIR=/tmp/imgui/backends | |
| cmake --build build -j$(nproc) | |
| - name: Strip & package | |
| run: | | |
| strip build/dedective build/dedective_gui | |
| mkdir -p DeDECTive | |
| cp build/dedective build/dedective_gui DeDECTive/ | |
| tar czf DeDECTive-linux-x86_64.tar.gz DeDECTive/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x86_64 | |
| path: DeDECTive-linux-x86_64.tar.gz | |
| # ── aarch64 cross-compile (CLI only — no GUI on cross) ───────────────────── | |
| build-aarch64: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install cross-compilation toolchain | |
| run: | | |
| sudo dpkg --add-architecture arm64 | |
| # Pin existing sources to amd64 only | |
| sudo sed -i '/^Types:/a Architectures: amd64' \ | |
| /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true | |
| # Add arm64 ports repository | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/arm64-ports.list | |
| echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/arm64-ports.list | |
| sudo apt-get update | |
| # Install cross toolchain first | |
| sudo apt-get install -y --no-install-recommends \ | |
| crossbuild-essential-arm64 cmake pkg-config | |
| # Then arm64 libraries | |
| sudo apt-get install -y --no-install-recommends \ | |
| libhackrf-dev:arm64 libpulse-dev:arm64 libusb-1.0-0-dev:arm64 | |
| - name: Build CLI (aarch64) | |
| run: | | |
| export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig | |
| export PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig | |
| cmake -S . -B build-arm64 \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_SYSTEM_NAME=Linux \ | |
| -DCMAKE_SYSTEM_PROCESSOR=aarch64 \ | |
| -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \ | |
| -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \ | |
| -DBUILD_GUI=OFF | |
| cmake --build build-arm64 -j$(nproc) --target dedective | |
| - name: Strip & package | |
| run: | | |
| aarch64-linux-gnu-strip build-arm64/dedective | |
| mkdir -p DeDECTive | |
| cp build-arm64/dedective DeDECTive/ | |
| tar czf DeDECTive-linux-aarch64.tar.gz DeDECTive/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-aarch64 | |
| path: DeDECTive-linux-aarch64.tar.gz | |
| # ── Create/update nightly release ────────────────────────────────────────── | |
| release: | |
| needs: [build-x86_64, build-aarch64] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create nightly release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Delete old nightly tag/release if it exists | |
| gh release delete nightly --yes 2>/dev/null || true | |
| git push origin :refs/tags/nightly 2>/dev/null || true | |
| DATE=$(date -u +%Y-%m-%d) | |
| gh release create nightly \ | |
| --title "Nightly Build ($DATE)" \ | |
| --notes "Automated nightly build from \`main\` branch. | |
| **Downloads:** | |
| - \`DeDECTive-linux-x86_64.tar.gz\` — CLI + GUI (x86_64) | |
| - \`DeDECTive-linux-aarch64.tar.gz\` — CLI only (aarch64/arm64) | |
| Built from commit: ${{ github.sha }}" \ | |
| --prerelease \ | |
| artifacts/linux-x86_64/DeDECTive-linux-x86_64.tar.gz \ | |
| artifacts/linux-aarch64/DeDECTive-linux-aarch64.tar.gz |