Skip to content
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,46 @@ jobs:
name: wheels-linux-armv6
path: dist

build-debian:
needs: [tag, build-linux, build-linux-aarch64]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- artifact: wheels-linux-x86_64
arch: amd64
- artifact: wheels-linux-i686
arch: i386
- artifact: wheels-linux-armv7
arch: armhf
- artifact: wheels-linux-aarch64
arch: arm64
steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
ref: ${{ needs.tag.outputs.branch }}

- name: Download wheel
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dist

- name: Convert wheel to Debian package
run: |
bash ci/scripts/wheel-to-deb.sh \
dist/eclipse_zenoh-*.whl \
python3-eclipse-zenoh \
${{ needs.tag.outputs.version }} \
${{ matrix.arch }}
Comment thread
sashacmc marked this conversation as resolved.
Outdated

- name: Upload Debian package artifact
uses: actions/upload-artifact@v4
with:
name: deb-${{ matrix.arch }}
path: "*.deb"

publish-pypi:
needs:
[
Expand Down Expand Up @@ -253,3 +293,21 @@ jobs:
branch: ${{ needs.tag.outputs.branch }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
archive-patterns: "^$"

publish-debian-github:
Comment thread
sashacmc marked this conversation as resolved.
Outdated
needs: [tag, build-debian, publish-github]
runs-on: ubuntu-latest
steps:
- name: Download Debian packages
uses: actions/download-artifact@v4
with:
pattern: deb-*
path: debs
merge-multiple: true

- name: Upload Debian packages to GitHub release
if: ${{ inputs.live-run || false }}
run: gh release upload ${{ needs.tag.outputs.version }} debs/*.deb --clobber
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }}
GH_REPO: ${{ github.repository }}
70 changes: 70 additions & 0 deletions ci/scripts/wheel-to-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
#
# Copyright (c) 2026 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
#
# Usage: wheel-to-deb.sh <wheel_file> <package_name> <version> <debian_arch>
# Example:
# wheel-to-deb.sh eclipse_zenoh-1.0.0-cp39-abi3-manylinux_2_17_x86_64.whl \
# python3-eclipse-zenoh 1.0.0 amd64

set -euo pipefail

if [[ $# -ne 4 ]]; then
echo "Usage: $0 <wheel_file> <package_name> <version> <debian_arch>" >&2
echo "Example: $0 eclipse_zenoh-1.0.0-cp39-abi3-manylinux_2_17_x86_64.whl python3-eclipse-zenoh 1.0.0 amd64" >&2
exit 1
fi

WHEEL=$1
PKG=$2
VER=$3
ARCH=$4
Comment thread
sashacmc marked this conversation as resolved.

WORKDIR=$(mktemp -d)
trap 'rm -rf "$WORKDIR"' EXIT

unzip -q "$WHEEL" -d "$WORKDIR/contents"

DIST_PKG="$WORKDIR/deb/usr/lib/python3/dist-packages"
mkdir -p "$DIST_PKG"

cp -r "$WORKDIR/contents/zenoh" "$DIST_PKG/"

Comment thread
sashacmc marked this conversation as resolved.
Comment thread
sashacmc marked this conversation as resolved.
# Copy dist-info for importlib.metadata compatibility, omitting stale RECORD
DIST_INFO=$(find "$WORKDIR/contents" -maxdepth 1 -name "*.dist-info" -type d)
if [[ -n "$DIST_INFO" ]]; then
cp -r "$DIST_INFO" "$DIST_PKG/"
rm -f "$DIST_PKG/$(basename "$DIST_INFO")/RECORD"
fi
Comment thread
sashacmc marked this conversation as resolved.
Outdated
Comment thread
sashacmc marked this conversation as resolved.

mkdir -p "$WORKDIR/deb/DEBIAN"
cat > "$WORKDIR/deb/DEBIAN/control" <<CTRL
Package: $PKG
Version: $VER
Architecture: $ARCH
Maintainer: ZettaScale Zenoh Team <zenoh@zettascale.tech>
Depends: python3 (>= 3.9), libc6
Section: python
Comment thread
sashacmc marked this conversation as resolved.
Priority: optional
Comment thread
sashacmc marked this conversation as resolved.
Homepage: https://zenoh.io
Description: Eclipse Zenoh Python bindings
Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
.
This package provides the Python bindings for Eclipse Zenoh, enabling
pub/sub, queryable and geo-distributed storage in Python.
.
Built from manylinux wheels.
CTRL

dpkg-deb --build --root-owner-group "$WORKDIR/deb" "${PKG}_${VER}_${ARCH}.deb"
echo "Built: ${PKG}_${VER}_${ARCH}.deb"
Loading