diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6389bad..95a0b62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,3 +80,41 @@ jobs: uses: softprops/action-gh-release@v2 with: files: ${{ matrix.artifact_name }} + + package-deb: + name: Package .deb (x86_64) + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.94" + + - name: Install cargo-deb + uses: taiki-e/install-action@v2 + with: + tool: cargo-deb + + - name: Build release binary + run: cargo build --release + + - name: Build .deb package + run: cargo deb --no-build + + - name: Upload .deb artifact + uses: actions/upload-artifact@v4 + with: + name: renderflow-deb-x86_64 + path: target/debian/*.deb + + - name: Upload .deb to GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: target/debian/*.deb diff --git a/Cargo.toml b/Cargo.toml index 4aa254f..5c5cb86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,18 @@ notify-debouncer-mini = "0.4" itertools = "0.14" +[package.metadata.deb] +maintainer = "Ego Hygiene " +copyright = "2024, Ego Hygiene" +license-file = ["LICENSE", "0"] +extended-description = "Spec-driven document rendering engine for transforming Markdown into PDF, HTML, and DOCX output." +depends = "$auto" +section = "utils" +priority = "optional" +assets = [ + ["target/release/renderflow", "usr/bin/", "755"], +] + [dev-dependencies] [profile.release] diff --git a/Taskfile.yml b/Taskfile.yml index 947a90f..f5fb633 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -68,3 +68,11 @@ tasks: requires: vars: - TARGET + + # Build a Debian package (.deb) for the current host architecture + # Requires: cargo-deb (cargo install cargo-deb) + package-deb: + desc: Build a .deb package (requires cargo-deb) + cmds: + - cargo build --release + - cargo deb --no-build