name: record-daemon on: push: branches: - main pull_request: branches: - main env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 jobs: # Make sure that the program correctly builds, # passes format and lints, as well as tests build-test: name: Format Check runs-on: ubuntu-latest defaults: run: working-directory: record-daemon steps: - name: Checkout repository uses: actions/checkout@v6 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - name: Check format run: cargo fmt --check - name: Install system build dependencies run: | sudo apt-get update sudo apt-get install -y pkg-config libglib2.0-dev libobs-dev libc6-dev clang - name: Build run: cargo build env: RUSTFLAGS: -Dwarnings - name: Lint run: cargo clippy --all-targets --all-features - name: Run tests with verbose logging (timeout 30min) run: timeout 30m cargo test -- --nocapture env: RUST_LOG: debug # Windows release build using cargo-xwin (cross-compile from Linux) build-windows-xwin: name: Build Windows (xwin) runs-on: ubuntu-latest needs: [build-test] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - name: Install cargo-xwin run: cargo install cargo-xwin - name: Build release for Windows run: cargo xwin build --release --target x86_64-pc-windows-msvc working-directory: record-daemon - name: Prepare release artifact run: | mkdir -p release # Copy the executable cp record-daemon/target/x86_64-pc-windows-msvc/release/record-daemon.exe release/ # Copy all DLL files from the release directory (libobs and dependencies) cp record-daemon/target/x86_64-pc-windows-msvc/release/*.dll release/ 2>/dev/null || true # Copy documentation cp record-daemon/README.md release/ 2>/dev/null || true - name: Create zip archive run: | cd release zip -r ../record-daemon-windows-x86_64.zip . - name: Upload Windows artifact uses: actions/upload-artifact@v4 with: name: record-daemon-windows-x86_64.zip path: record-daemon-windows-x86_64.zip retention-days: 30