From 1f81ea2b2aa1f430753d92213796b02812bd90a9 Mon Sep 17 00:00:00 2001 From: tino097 Date: Mon, 21 Oct 2024 10:13:14 +0200 Subject: [PATCH 1/4] Debian package will contain qsv, qsvdp, qsvlite --- Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c2012627e..19029ed8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -392,7 +392,9 @@ maintainer = "Konstantin Sivakov " copyright = "2024, datHere Inc. " extended-description = """A high performance CSV data-wrangling toolkit.""" depends = "$auto" -features = ["feature_capable"] +features = ["feature_capable", "lite", "datapusher_plus"] section = "utility" priority = "optional" -assets = [["target/release/qsv", "/usr/local/bin/", "755"]] +assets = [ + ["target/release/qsv", "/usr/local/bin/", "755"] +] From eb9edf37a80175c1f8bbf0c824d33d895fb305fb Mon Sep 17 00:00:00 2001 From: tino097 Date: Mon, 21 Oct 2024 16:08:00 +0200 Subject: [PATCH 2/4] Create multiple deb packages --- .github/workflows/publish-deb-package.yml | 48 ++++++++--------------- Cargo.toml | 17 +++++++- packages/README.md | 2 - scripts/build-deb.sh | 20 ++++++++++ 4 files changed, 53 insertions(+), 34 deletions(-) delete mode 100644 packages/README.md create mode 100755 scripts/build-deb.sh diff --git a/.github/workflows/publish-deb-package.yml b/.github/workflows/publish-deb-package.yml index 1ddbb1a8e..bf1636912 100644 --- a/.github/workflows/publish-deb-package.yml +++ b/.github/workflows/publish-deb-package.yml @@ -1,29 +1,20 @@ name: Publish Debian Package on: - workflow_dispatch: + release: + types: [published] env: QSV_KIND: prebuilt jobs: - analyze-tags: + build-and-publish: runs-on: ubuntu-22.04 - outputs: - previous-tag: ${{ steps.previoustag.outputs.tag }} steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get previous tag - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" + - name: Checkout repository + uses: actions/checkout@v4 - build: - needs: analyze-tags - runs-on: ubuntu-22.04 - steps: - - name: Installing Rust toolchain + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -31,25 +22,20 @@ jobs: target: x86_64-unknown-linux-gnu override: true - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ needs.analyze-tags.outputs.previous-tag }} - - - name: apt-get update Ubuntu, libwayland-dev + - name: Install dependencies run: | sudo apt-get update - sudo apt-get install libwayland-dev + sudo apt-get install -y libwayland-dev + cargo install cargo-deb - - name: Install Cargo Deb - run: cargo install cargo-deb - - - name: Build Debian Package - run: cargo deb --target=x86_64-unknown-linux-gnu + - name: Build all Debian packages + id: build + run: | + chmod +x .scripts/build_all_debs.sh + echo "DEB_PATHS=$(.scripts/build_all_debs.sh)" >> $GITHUB_OUTPUT - - name: Upload Debian Package + - name: Upload Debian Packages as Artifacts uses: actions/upload-artifact@v3 with: - name: qsv-deb - path: target/x86_64-unknown-linux-gnu/debian/*.deb - + name: debian-packages + path: ${{ steps.build.outputs.DEB_PATHS }} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index f82ee5269..bd4a472ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -390,9 +390,24 @@ maintainer = "Konstantin Sivakov " copyright = "2024, datHere Inc. " extended-description = """A high performance CSV data-wrangling toolkit.""" depends = "$auto" -features = ["feature_capable", "lite", "datapusher_plus"] section = "utility" priority = "optional" + +# Default feature and asset +features = ["feature_capable"] assets = [ ["target/release/qsv", "/usr/local/bin/", "755"] ] + +# Conditional features and assets +[package.metadata.deb.variants.lite] +features = ["lite"] +assets = [ + ["target/release/qsvlite", "/usr/local/bin/", "755"] +] + +[package.metadata.deb.variants.datapusher_plus] +features = ["datapusher_plus"] +assets = [ + ["target/release/qsvdp", "/usr/local/bin/", "755"] +] diff --git a/packages/README.md b/packages/README.md deleted file mode 100644 index deadc39cd..000000000 --- a/packages/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Debian Packages -This directory contains the Debian packages for the QSV library. diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh new file mode 100755 index 000000000..6f71927e6 --- /dev/null +++ b/scripts/build-deb.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +build_variant() { + local variant=$1 + local output_dir="target/debian" + + echo "Building ${variant} package..." + if [ "$variant" = "default" ]; then + cargo deb + else + cargo deb --variant=$variant + fi + +} + +default_path=$(build_variant "default") +lite_path=$(build_variant "lite") +datapusher_plus_path=$(build_variant "datapusher_plus") + +echo "DEB_PATHS=${default_path} ${lite_path} ${datapusher_plus_path}" \ No newline at end of file From 74b1f595568b4cf16dfd9509084b6533e5137663 Mon Sep 17 00:00:00 2001 From: tino097 Date: Mon, 21 Oct 2024 22:33:41 +0200 Subject: [PATCH 3/4] Use release publish to trigger debian package build Include all the debin packages in release --- .github/workflows/publish-deb-package.yml | 38 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-deb-package.yml b/.github/workflows/publish-deb-package.yml index bf1636912..4de154caa 100644 --- a/.github/workflows/publish-deb-package.yml +++ b/.github/workflows/publish-deb-package.yml @@ -31,11 +31,43 @@ jobs: - name: Build all Debian packages id: build run: | - chmod +x .scripts/build_all_debs.sh - echo "DEB_PATHS=$(.scripts/build_all_debs.sh)" >> $GITHUB_OUTPUT + chmod +x scripts/build-deb.sh + echo "Running build-deb.sh..." + build_output=$(./scripts/build-deb.sh) + echo "Build script output:" + echo "$build_output" + + # Extract paths from the output + deb_paths=$(echo "$build_output" | grep -oP '/[^ ]*\.deb' | tr '\n' ' ') + + echo "Extracted .deb paths:" + echo "$deb_paths" + + echo "DEB_PATHS=$deb_paths" >> $GITHUB_OUTPUT + + - name: List built packages + run: | + echo "Built packages:" + ls -l ${{ steps.build.outputs.DEB_PATHS }} + + - name: Rename and move Debian packages + run: | + mkdir -p renamed_debs + mv $(echo "${{ steps.build.outputs.DEB_PATHS }}" | awk '{print $1}') renamed_debs/qsv.deb + mv $(echo "${{ steps.build.outputs.DEB_PATHS }}" | awk '{print $2}') renamed_debs/qsvlite.deb + mv $(echo "${{ steps.build.outputs.DEB_PATHS }}" | awk '{print $3}') renamed_debs/qsvdp.deb + echo "Renamed packages:" + ls -l renamed_debs + + - name: Upload Debian Packages as Artifacts + uses: actions/upload-artifact@v3 + with: + name: debian-packages + path: renamed_debs/*.deb - name: Upload Debian Packages as Artifacts uses: actions/upload-artifact@v3 with: name: debian-packages - path: ${{ steps.build.outputs.DEB_PATHS }} \ No newline at end of file + path: | + /home/runner/work/qsv/qsv/target/debian/*.deb \ No newline at end of file From 6287340bb82fc96089036b64a6d5d1808146f357 Mon Sep 17 00:00:00 2001 From: tino097 Date: Mon, 2 Dec 2024 15:31:51 +0100 Subject: [PATCH 4/4] Update for luau --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bd4a472ef..f6d5efbf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -407,7 +407,7 @@ assets = [ ] [package.metadata.deb.variants.datapusher_plus] -features = ["datapusher_plus"] +features = ["datapusher_plus", "luau"] assets = [ ["target/release/qsvdp", "/usr/local/bin/", "755"] ]