Skip to content

Commit

Permalink
Merge pull request #2226 from tino097/update-deb-package
Browse files Browse the repository at this point in the history
Update deb package
  • Loading branch information
jqnatividad authored Dec 2, 2024
2 parents 8325218 + 648f125 commit ef0183a
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 33 deletions.
76 changes: 47 additions & 29 deletions .github/workflows/publish-deb-package.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,73 @@
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
profile: minimal
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 all Debian packages
id: build
run: |
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: Build Debian Package
run: cargo deb --target=x86_64-unknown-linux-gnu
- name: List built packages
run: |
echo "Built packages:"
ls -l ${{ steps.build.outputs.DEB_PATHS }}
- name: Upload Debian Package
- 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: qsv-deb
path: target/x86_64-unknown-linux-gnu/debian/*.deb
name: debian-packages
path: renamed_debs/*.deb

- name: Upload Debian Packages as Artifacts
uses: actions/upload-artifact@v3
with:
name: debian-packages
path: |
/home/runner/work/qsv/qsv/target/debian/*.deb
21 changes: 19 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,24 @@ maintainer = "Konstantin Sivakov <[email protected]>"
copyright = "2024, datHere Inc. <www.dathere.com>"
extended-description = """A high performance CSV data-wrangling toolkit."""
depends = "$auto"
features = ["feature_capable"]
section = "utility"
priority = "optional"
assets = [["target/release/qsv", "/usr/local/bin/", "755"]]

# 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", "luau"]
assets = [
["target/release/qsvdp", "/usr/local/bin/", "755"]
]
2 changes: 0 additions & 2 deletions packages/README.md

This file was deleted.

20 changes: 20 additions & 0 deletions scripts/build-deb.sh
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit ef0183a

Please sign in to comment.