Simplify CI to use Docker build approach
Some checks failed
Build ostree packages from sid to trixie / Build ostree packages (push) Failing after 2m30s
Some checks failed
Build ostree packages from sid to trixie / Build ostree packages (push) Failing after 2m30s
- Remove container from job definition to avoid network issues - Use Docker-in-Docker approach with proper Debian unstable environment - Create build script that runs inside Docker container - This should resolve the 'forgejo hostname not found' issue - Simpler and more reliable than trying to mix Ubuntu runner with Debian packages
This commit is contained in:
parent
26155427bf
commit
a6b65be912
1 changed files with 87 additions and 131 deletions
|
|
@ -10,152 +10,116 @@ jobs:
|
||||||
build:
|
build:
|
||||||
name: Build ostree packages
|
name: Build ostree packages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
permissions:
|
||||||
image: docker.io/node:iron-trixie
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup environment
|
|
||||||
run: |
|
run: |
|
||||||
# Try apt-cacher-ng first, fallback to Debian's automatic mirror selection
|
echo "Cloning repository..."
|
||||||
echo "Checking for apt-cacher-ng availability..."
|
git clone https://git.raines.xyz/particle-os/ostree.git /tmp/ostree
|
||||||
|
cd /tmp/ostree
|
||||||
|
git fetch --all
|
||||||
|
git checkout ${{ github.sha || gitea.sha || 'main' }}
|
||||||
|
|
||||||
# Quick check with timeout to avoid hanging
|
- name: Build ostree packages in Docker
|
||||||
if timeout 10 curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
|
run: |
|
||||||
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
|
echo "Building ostree packages using Docker..."
|
||||||
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list
|
|
||||||
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list
|
|
||||||
else
|
|
||||||
echo "⚠️ apt-cacher-ng not available, using standard Debian mirrors..."
|
|
||||||
echo "deb http://deb.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list
|
|
||||||
echo "deb-src http://deb.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update package lists
|
# Create a Dockerfile for the build environment
|
||||||
echo "Updating package lists..."
|
cat > /tmp/ostree/Dockerfile.build << 'EOF'
|
||||||
apt update -y
|
FROM debian:unstable
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
echo "Installing build dependencies..."
|
RUN apt-get update && apt-get install -y \
|
||||||
apt-get install -y build-essential fakeroot devscripts debian-keyring equivs
|
build-essential \
|
||||||
|
fakeroot \
|
||||||
|
devscripts \
|
||||||
|
debian-keyring \
|
||||||
|
equivs \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
- name: Clone ostree from sid
|
# Add Debian sources
|
||||||
run: |
|
RUN echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list && \
|
||||||
|
echo "deb-src http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
# Copy the CI script
|
||||||
|
COPY build-ostree.sh /workspace/
|
||||||
|
RUN chmod +x /workspace/build-ostree.sh
|
||||||
|
|
||||||
|
CMD ["/workspace/build-ostree.sh"]
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Create the build script
|
||||||
|
cat > /tmp/ostree/build-ostree.sh << 'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Starting ostree build process..."
|
||||||
|
|
||||||
|
# Update package lists
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
# Clone ostree from Debian sid
|
||||||
echo "Cloning ostree from Debian sid..."
|
echo "Cloning ostree from Debian sid..."
|
||||||
cd /tmp
|
apt source ostree
|
||||||
echo "Current directory before apt source:"
|
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
echo "Running apt source ostree..."
|
|
||||||
if apt source ostree; then
|
|
||||||
echo "apt source ostree succeeded"
|
|
||||||
else
|
|
||||||
echo "apt source ostree failed!"
|
|
||||||
echo "Checking available packages:"
|
|
||||||
apt search ostree | head -10
|
|
||||||
echo "Checking sources:"
|
|
||||||
cat /etc/apt/sources.list
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "After apt source, checking directory:"
|
|
||||||
ls -la
|
|
||||||
echo "Looking for ostree directory:"
|
|
||||||
ls -la ostree-* || echo "No ostree directory found"
|
|
||||||
cd ostree-*
|
cd ostree-*
|
||||||
|
|
||||||
echo "Changed to ostree directory:"
|
echo "Changed to ostree directory:"
|
||||||
pwd
|
pwd
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
- name: Install build dependencies
|
# Install build dependencies
|
||||||
run: |
|
|
||||||
cd /tmp/ostree-*
|
|
||||||
echo "Installing build dependencies..."
|
echo "Installing build dependencies..."
|
||||||
mk-build-deps -i -t 'apt-get -y' debian/control || echo "Build deps installation failed, continuing..."
|
mk-build-deps -i -t 'apt-get -y' debian/control
|
||||||
apt-get update
|
apt-get build-dep -y .
|
||||||
apt-get build-dep -y . || echo "Build deps installation failed, continuing..."
|
|
||||||
|
|
||||||
# Ensure we have all necessary build tools
|
# Add backport revision number
|
||||||
echo "Installing additional build tools..."
|
|
||||||
apt-get install -y build-essential fakeroot devscripts || echo "Additional tools installation failed"
|
|
||||||
|
|
||||||
- name: Check source package structure
|
|
||||||
run: |
|
|
||||||
cd /tmp/ostree-*
|
|
||||||
echo "Checking source package structure..."
|
|
||||||
ls -la
|
|
||||||
echo "Debian directory contents:"
|
|
||||||
ls -la debian/
|
|
||||||
echo "Control file:"
|
|
||||||
cat debian/control
|
|
||||||
echo "Rules file:"
|
|
||||||
cat debian/rules
|
|
||||||
echo "Changelog:"
|
|
||||||
head -20 debian/changelog
|
|
||||||
|
|
||||||
- name: Add backport revision number
|
|
||||||
run: |
|
|
||||||
cd /tmp/ostree-*
|
|
||||||
echo "Adding backport revision number..."
|
echo "Adding backport revision number..."
|
||||||
dch --bpo || echo "dch --bpo failed, continuing..."
|
dch --bpo
|
||||||
|
|
||||||
- name: Test build
|
# Test build
|
||||||
run: |
|
|
||||||
cd /tmp/ostree-*
|
|
||||||
echo "Testing build with fakeroot debian/rules binary..."
|
echo "Testing build with fakeroot debian/rules binary..."
|
||||||
if fakeroot debian/rules binary; then
|
fakeroot debian/rules binary
|
||||||
echo "Test build successful!"
|
|
||||||
else
|
|
||||||
echo "Test build failed!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build packages
|
# Build packages
|
||||||
run: |
|
|
||||||
cd /tmp/ostree-*
|
|
||||||
echo "Building ostree packages..."
|
echo "Building ostree packages..."
|
||||||
echo "Current directory before build:"
|
dpkg-buildpackage --build=binary --unsigned-changes
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
echo "Running dpkg-buildpackage..."
|
|
||||||
echo "Build dependencies check:"
|
|
||||||
echo "Checking if key dependencies are installed..."
|
|
||||||
dpkg -l | grep libglib2.0-dev || echo "libglib2.0-dev not found"
|
|
||||||
dpkg -l | grep libfuse3-dev || echo "libfuse3-dev not found"
|
|
||||||
dpkg -l | grep libsystemd-dev || echo "libsystemd-dev not found"
|
|
||||||
|
|
||||||
echo "Running dpkg-buildpackage with proper Debian backport flags..."
|
|
||||||
echo "Using --build=binary --unsigned-changes as per Debian guidelines..."
|
|
||||||
if dpkg-buildpackage --build=binary --unsigned-changes; then
|
|
||||||
echo "Build successful!"
|
|
||||||
else
|
|
||||||
echo "Build failed! Checking for any partial packages..."
|
|
||||||
ls -la /tmp/*.deb 2>/dev/null || echo "No .deb files found after failed build"
|
|
||||||
echo "Checking build logs..."
|
|
||||||
ls -la /tmp/ostree-*/ 2>/dev/null || echo "No build directory found"
|
|
||||||
echo "Checking for build errors..."
|
|
||||||
find /tmp -name "*.log" -exec echo "=== {} ===" \; -exec cat {} \; 2>/dev/null || echo "No log files found"
|
|
||||||
echo "Checking debian/rules..."
|
|
||||||
cat debian/rules 2>/dev/null || echo "No debian/rules found"
|
|
||||||
echo "Checking debian/control..."
|
|
||||||
cat debian/control 2>/dev/null || echo "No debian/control found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Build completed! Checking for generated packages..."
|
echo "Build completed! Checking for generated packages..."
|
||||||
ls -la /tmp/*.deb 2>/dev/null || echo "No .deb files found"
|
ls -la ../*.deb
|
||||||
echo "Copying packages to workspace..."
|
|
||||||
cp /tmp/*.deb /workspace/ 2>/dev/null || echo "No .deb files to copy"
|
# Copy packages to workspace
|
||||||
cp /tmp/*.dsc /workspace/ 2>/dev/null || echo "No .dsc files to copy"
|
cp ../*.deb /workspace/
|
||||||
cp /tmp/*.tar.xz /workspace/ 2>/dev/null || echo "No .tar.xz files to copy"
|
cp ../*.dsc /workspace/ 2>/dev/null || true
|
||||||
echo "Workspace contents after copy:"
|
cp ../*.tar.xz /workspace/ 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "Packages copied to workspace:"
|
||||||
ls -la /workspace/
|
ls -la /workspace/
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Build and run the Docker container
|
||||||
|
cd /tmp/ostree
|
||||||
|
docker build -f Dockerfile.build -t ostree-builder .
|
||||||
|
|
||||||
|
# Run the build
|
||||||
|
docker run --rm -v /tmp/ostree:/workspace ostree-builder
|
||||||
|
|
||||||
|
# Check results
|
||||||
|
echo "Build completed. Checking for packages..."
|
||||||
|
ls -la /tmp/ostree/*.deb || echo "No .deb files found"
|
||||||
|
|
||||||
- name: Upload to Forgejo Debian Registry
|
- name: Upload to Forgejo Debian Registry
|
||||||
run: |
|
run: |
|
||||||
echo "Uploading to Forgejo Debian Registry..."
|
echo "Uploading to Forgejo Debian Registry..."
|
||||||
|
cd /tmp/ostree
|
||||||
|
|
||||||
echo "Files in current directory:"
|
echo "Files in current directory:"
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
|
|
@ -177,11 +141,3 @@ jobs:
|
||||||
echo "🎯 Debian package publishing complete!"
|
echo "🎯 Debian package publishing complete!"
|
||||||
echo "📦 Packages are now available in Forgejo Debian Registry"
|
echo "📦 Packages are now available in Forgejo Debian Registry"
|
||||||
echo "🔧 To install: apt install ostree libostree-1-1"
|
echo "🔧 To install: apt install ostree libostree-1-1"
|
||||||
|
|
||||||
- name: Create artifacts
|
|
||||||
run: |
|
|
||||||
echo "Creating artifacts..."
|
|
||||||
mkdir -p /tmp/artifacts
|
|
||||||
cp *.deb *.dsc *.tar.xz /tmp/artifacts/ 2>/dev/null || echo "No packages to copy"
|
|
||||||
echo "Artifacts created in /tmp/artifacts/"
|
|
||||||
ls -la /tmp/artifacts/
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue