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
143 lines
No EOL
4.6 KiB
YAML
143 lines
No EOL
4.6 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
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- 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: Build ostree packages in Docker
|
|
run: |
|
|
echo "Building ostree packages using Docker..."
|
|
|
|
# Create a Dockerfile for the build environment
|
|
cat > /tmp/ostree/Dockerfile.build << 'EOF'
|
|
FROM debian:unstable
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
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
|
|
apt-get update
|
|
|
|
# Clone ostree from Debian sid
|
|
echo "Cloning ostree from Debian sid..."
|
|
apt source ostree
|
|
cd ostree-*
|
|
|
|
echo "Changed to ostree directory:"
|
|
pwd
|
|
ls -la
|
|
|
|
# Install build dependencies
|
|
echo "Installing build dependencies..."
|
|
mk-build-deps -i -t 'apt-get -y' debian/control
|
|
apt-get build-dep -y .
|
|
|
|
# Add backport revision number
|
|
echo "Adding backport revision number..."
|
|
dch --bpo
|
|
|
|
# Test build
|
|
echo "Testing build with fakeroot debian/rules binary..."
|
|
fakeroot debian/rules binary
|
|
|
|
# Build packages
|
|
echo "Building ostree packages..."
|
|
dpkg-buildpackage --build=binary --unsigned-changes
|
|
|
|
echo "Build completed! Checking for generated packages..."
|
|
ls -la ../*.deb
|
|
|
|
# Copy packages to workspace
|
|
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
|
|
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"
|
|
echo "Searching for .deb files in all subdirectories:"
|
|
find . -name "*.deb" -type f
|
|
|
|
# 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" |