Remove unnecessary Docker container - use simple approach like composefs
Some checks failed
Build ostree packages from sid to trixie / Build ostree packages (push) Failing after 10s
Some checks failed
Build ostree packages from sid to trixie / Build ostree packages (push) Failing after 10s
- Remove Docker-in-Docker complexity that was causing build script issues - Use direct approach on Ubuntu runner with Debian repositories - Follow the same pattern as the working composefs CI - Much simpler and more reliable - no container networking issues - Just add Debian repos to Ubuntu runner and build directly
This commit is contained in:
parent
a6b65be912
commit
71f1e86f84
1 changed files with 62 additions and 80 deletions
|
|
@ -23,113 +23,95 @@ jobs:
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git checkout ${{ github.sha || gitea.sha || 'main' }}
|
git checkout ${{ github.sha || gitea.sha || 'main' }}
|
||||||
|
|
||||||
- name: Build ostree packages in Docker
|
- name: Setup Debian environment
|
||||||
run: |
|
run: |
|
||||||
echo "Building ostree packages using Docker..."
|
echo "Setting up Debian environment for building..."
|
||||||
|
|
||||||
# Create a Dockerfile for the build environment
|
# Add Debian repositories
|
||||||
cat > /tmp/ostree/Dockerfile.build << 'EOF'
|
echo "Adding Debian unstable repositories..."
|
||||||
FROM debian:unstable
|
echo "deb http://deb.debian.org/debian unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list
|
||||||
|
echo "deb-src http://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.list
|
||||||
|
|
||||||
# Install build dependencies
|
# Add Debian keyring
|
||||||
RUN apt-get update && apt-get install -y \
|
sudo apt update
|
||||||
build-essential \
|
sudo apt install -y debian-archive-keyring
|
||||||
fakeroot \
|
|
||||||
devscripts \
|
|
||||||
debian-keyring \
|
|
||||||
equivs \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Add Debian sources
|
|
||||||
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
|
# Update package lists
|
||||||
apt-get update
|
sudo apt update -y
|
||||||
|
|
||||||
# Clone ostree from Debian sid
|
# Install essential build tools
|
||||||
|
sudo apt install -y build-essential fakeroot devscripts curl git
|
||||||
|
|
||||||
|
- name: Clone ostree from Debian sid
|
||||||
|
run: |
|
||||||
echo "Cloning ostree from Debian sid..."
|
echo "Cloning ostree from Debian sid..."
|
||||||
apt source ostree
|
cd /tmp
|
||||||
cd ostree-*
|
apt source ostree || { echo "apt source ostree failed!"; exit 1; }
|
||||||
|
cd ostree-* || { echo "Failed to change to ostree directory!"; exit 1; }
|
||||||
echo "Changed to ostree directory:"
|
echo "Changed to ostree directory:"
|
||||||
pwd
|
pwd
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
# Install build dependencies
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
echo "Installing build dependencies..."
|
echo "Installing build dependencies..."
|
||||||
mk-build-deps -i -t 'apt-get -y' debian/control
|
cd /tmp/ostree-*
|
||||||
apt-get build-dep -y .
|
sudo mk-build-deps -i -t 'apt-get -y' debian/control || echo "mk-build-deps failed, continuing..."
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get build-dep -y . || echo "Build deps installation failed, continuing..."
|
||||||
|
|
||||||
# Add backport revision number
|
- name: Add backport revision number
|
||||||
|
run: |
|
||||||
echo "Adding backport revision number..."
|
echo "Adding backport revision number..."
|
||||||
dch --bpo
|
cd /tmp/ostree-*
|
||||||
|
dch --bpo || echo "dch --bpo failed, continuing..."
|
||||||
|
|
||||||
# Test build
|
- name: Test build
|
||||||
|
run: |
|
||||||
echo "Testing build with fakeroot debian/rules binary..."
|
echo "Testing build with fakeroot debian/rules binary..."
|
||||||
fakeroot debian/rules binary
|
cd /tmp/ostree-*
|
||||||
|
if fakeroot debian/rules binary; then
|
||||||
|
echo "Test build successful!"
|
||||||
|
else
|
||||||
|
echo "Test build failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Build packages
|
- name: Build packages
|
||||||
|
run: |
|
||||||
echo "Building ostree packages..."
|
echo "Building ostree packages..."
|
||||||
dpkg-buildpackage --build=binary --unsigned-changes
|
cd /tmp/ostree-*
|
||||||
|
echo "Current directory before build:"
|
||||||
|
pwd
|
||||||
|
ls -la
|
||||||
|
|
||||||
|
echo "Running dpkg-buildpackage..."
|
||||||
|
if dpkg-buildpackage --build=binary --unsigned-changes; then
|
||||||
|
echo "Build successful!"
|
||||||
|
else
|
||||||
|
echo "Build failed! Checking for any partial packages..."
|
||||||
|
ls -la ../*.deb 2>/dev/null || echo "No .deb files found after failed build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Build completed! Checking for generated packages..."
|
echo "Build completed! Checking for generated packages..."
|
||||||
ls -la ../*.deb
|
ls -la ../*.deb
|
||||||
|
echo "Copying packages to workspace..."
|
||||||
# Copy packages to workspace
|
cp ../*.deb /workspace/ 2>/dev/null || echo "No .deb files to copy"
|
||||||
cp ../*.deb /workspace/
|
|
||||||
cp ../*.dsc /workspace/ 2>/dev/null || true
|
|
||||||
cp ../*.tar.xz /workspace/ 2>/dev/null || true
|
|
||||||
|
|
||||||
echo "Packages copied to 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
|
cd /tmp/ostree-*
|
||||||
|
|
||||||
echo "Files in current directory:"
|
echo "Files in current directory:"
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
echo "Looking for .deb files:"
|
echo "Looking for .deb files:"
|
||||||
ls -la *.deb 2>/dev/null || echo "No .deb files found"
|
ls -la ../*.deb 2>/dev/null || echo "No .deb files found"
|
||||||
echo "Searching for .deb files in all subdirectories:"
|
|
||||||
find . -name "*.deb" -type f
|
|
||||||
|
|
||||||
# Upload .deb files to Forgejo Debian Registry
|
# Upload .deb files to Forgejo Debian Registry
|
||||||
for deb_file in *.deb; do
|
for deb_file in ../*.deb; do
|
||||||
if [ -f "$deb_file" ]; then
|
if [ -f "$deb_file" ]; then
|
||||||
echo "Uploading $deb_file to Forgejo Debian Registry..."
|
echo "Uploading $deb_file to Forgejo Debian Registry..."
|
||||||
curl --upload-file "$deb_file" \
|
curl --upload-file "$deb_file" \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue