ostree/.forgejo/workflows/ci.yml
robojerk 86fce1e981
Some checks failed
Build ostree packages from sid to trixie / Build ostree packages (push) Failing after 6m3s
Fix step order - install git before checkout
- Move setup step before checkout step
- Install git and essential tools before trying to use git
- This should resolve the 'git: not found' error
- Proper order: setup environment -> checkout code -> build packages
2025-09-06 11:33:06 -07:00

132 lines
No EOL
4.8 KiB
YAML

---
name: Build ostree packages from sid to trixie
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
name: Build ostree packages
runs-on: ubuntu-latest
container:
image: debian:unstable
permissions:
contents: read
packages: write
steps:
- name: Setup Debian environment
run: |
echo "Setting up Debian environment for building..."
# Try apt-cacher-ng first, fallback to Debian's automatic mirror selection
echo "Checking for apt-cacher-ng availability..."
# Quick check with timeout to avoid hanging
if timeout 10 curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian unstable main" > /etc/apt/sources.list
echo "deb-src http://192.168.1.101:3142/ftp.us.debian.org/debian unstable main" >> /etc/apt/sources.list
else
echo "⚠️ apt-cacher-ng not available, using standard Debian mirrors..."
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
fi
# Update package lists
apt update -y
# Install essential tools first (including git)
apt install -y git curl build-essential fakeroot devscripts
- name: Checkout code
run: |
echo "Cloning repository..."
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' }}
- name: Clone ostree from Debian sid
run: |
echo "Cloning ostree from Debian sid..."
cd /tmp
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:"
pwd
ls -la
- name: Install build dependencies
run: |
echo "Installing build dependencies..."
cd /tmp/ostree-*
mk-build-deps -i -t 'apt-get -y' debian/control || echo "mk-build-deps failed, continuing..."
apt-get update
apt-get build-dep -y . || echo "Build deps installation failed, continuing..."
- name: Add backport revision number
run: |
echo "Adding backport revision number..."
cd /tmp/ostree-*
dch --bpo || echo "dch --bpo failed, continuing..."
- name: Test build
run: |
echo "Testing build with 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
- name: Build packages
run: |
echo "Building ostree packages..."
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..."
ls -la ../*.deb
echo "Copying packages to workspace..."
cp ../*.deb /workspace/ 2>/dev/null || echo "No .deb files to copy"
- name: Upload to Forgejo Debian Registry
run: |
echo "Uploading to Forgejo Debian Registry..."
cd /tmp/ostree-*
echo "Files in current directory:"
ls -la
echo "Looking for .deb files:"
ls -la ../*.deb 2>/dev/null || echo "No .deb files found"
# Upload .deb files to Forgejo Debian Registry
for deb_file in ../*.deb; do
if [ -f "$deb_file" ]; then
echo "Uploading $deb_file to Forgejo Debian Registry..."
curl --upload-file "$deb_file" \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
"https://git.raines.xyz/api/packages/particle-os/debian/upload?distro=trixie&component=main&architecture=amd64"
fi
done
echo "🎯 Debian package publishing complete!"
echo "📦 Packages are now available in Forgejo Debian Registry"
echo "🔧 To install: apt install ostree libostree-1-1"