Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .github/workflows/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ on:
- unstable
workflow_call:


jobs:
build-source-package:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
dist: ${{ fromJSON(vars.BUILD_DISTS) }}
arch: ${{ fromJSON(vars.BUILD_ARCHS) }}
exclude: ${{ fromJSON(vars.BUILD_EXCLUDE) }}
dist: ${{ fromJSON(vars.BUILD_DISTS || '["bookworm"]') }}
arch: ${{ fromJSON(vars.BUILD_ARCHS || '["amd64"]') }}
exclude: ${{ fromJSON(vars.BUILD_EXCLUDE || '[]') }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -39,22 +40,22 @@ jobs:
mkdir -p redis-${VERSION}
tar --extract --gunzip --file redis_${VERSION}.orig.tar.gz --strip-components=1 -C redis-${VERSION}
sed -i 's/INSTALL_BIN=\$(PREFIX)\/bin/INSTALL_BIN=\$(DESTDIR)\$(PREFIX)\/bin/' redis-${VERSION}/src/Makefile

echo "===== Updating all Redis module versions to 'master' ====="
find redis-${VERSION}/modules -name "Makefile" -type f | while read -r makefile; do
echo "Processing $makefile"
echo " Before change:"
grep "MODULE_VERSION" "$makefile" || echo " No MODULE_VERSION found"

# Update the MODULE_VERSION to 'master'
sed -i 's/MODULE_VERSION = .*/MODULE_VERSION = master/g' "$makefile"

echo " After change:"
grep "MODULE_VERSION" "$makefile" || echo " No MODULE_VERSION found after update"
echo "-----------------------------------"
done
echo "===== Module version updates completed ====="

cp -pr debian redis-${VERSION}
sed -i "s/@RELEASE@/${{ matrix.dist }}/g" redis-${VERSION}/debian/changelog
( cd redis-${VERSION} && dpkg-buildpackage -S )
Expand All @@ -72,9 +73,9 @@ jobs:
strategy:
fail-fast: false
matrix:
dist: ${{ fromJSON(vars.BUILD_DISTS) }}
arch: ${{ fromJSON(vars.BUILD_ARCHS) }}
exclude: ${{ fromJSON(vars.BUILD_EXCLUDE) }}
dist: ${{ fromJSON(vars.BUILD_DISTS || '["bookworm"]') }}
arch: ${{ fromJSON(vars.BUILD_ARCHS || '["amd64"]') }}
exclude: ${{ fromJSON(vars.BUILD_EXCLUDE || '[]') }}
needs: build-source-package
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -121,6 +122,8 @@ jobs:
--dist ${{ matrix.dist }} \
--build-dep-resolver=apt \
--chroot-setup-commands="apt-get update && apt-get install -y build-essential" \


*.dsc
- name: Upload binary package artifact
uses: actions/upload-artifact@v4
Expand All @@ -135,8 +138,8 @@ jobs:
strategy:
fail-fast: false
matrix:
image: ${{ fromJSON(vars.SMOKE_TEST_IMAGES) }}
arch: [amd64, arm64]
image: ${{ fromJSON(vars.SMOKE_TEST_IMAGES || '["debian:bookworm"]') }}
arch: ${{ fromJSON(vars.BUILD_ARCHS || '["amd64","arm64"]') }}
container: ${{ matrix.image }}
steps:
- name: Extract distribution from image
Expand Down
17 changes: 12 additions & 5 deletions setup_sbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ cat > "$SBUILD_CONF" << EOF
$host_arch $arch $dist $url
EOF

# Create the sbuild chroot with the configuration
sbuild-createchroot --arch=${arch} --make-sbuild-tarball=/var/lib/sbuild/${dist}-${arch}.tar.gz ${dist} $(mktemp -d) ${url}
# Create the sbuild chroot with the configuration (use directory chroot so installed tools persist into build clones)
sbuild-createchroot --arch=${arch} ${dist} /var/lib/sbuild/chroots/${dist}-${arch} ${url}

# For cross-compilation, install the necessary packages
if [ "$arch" != "$host_arch" ]; then
echo "Setting up cross-compilation environment from $host_arch to $arch"

# Install cross-compilation tools in the chroot
schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get update
schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y crossbuild-essential-${arch}

# Create a file to tell sbuild this is a cross-compilation environment
schroot -c source:${dist}-${arch}-sbuild -d / -- touch /etc/sbuild-cross-building
fi
Expand Down Expand Up @@ -85,7 +85,14 @@ fi

# Install native build tools in the chroot
schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get update
schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y build-essential python3 python3-pip python3-venv python3-dev g++ clang
schroot -c source:${dist}-${arch}-sbuild -d / -- apt-get install -y build-essential python3 python3-pip python3-venv python3-dev g++ clang curl

# Install Astral uv inside chroot for RediSearch test dependencies that expect it
schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "set -e; curl --proto '=https' --tlsv1.2 -LsSf https://astral.sh/uv/install.sh | sh"
# Make uv available system-wide in chroot PATH
schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "install -m 0755 \"$HOME/.local/bin/uv\" /usr/local/bin/uv || cp -f \"$HOME/.local/bin/uv\" /usr/local/bin/uv"
# Verify uv installed and ensure it's in PATH via /usr/bin
schroot -c source:${dist}-${arch}-sbuild -d / -- bash -lc "ln -sf /usr/local/bin/uv /usr/bin/uv && /usr/bin/uv -V"

# Install latest CMake version for Jammy and Bullseye
if [ "$dist" = "jammy" ] || [ "$dist" = "bullseye" ]; then
Expand Down
Loading